@simplysm/service-client 14.0.18 → 14.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/features.md +11 -11
- package/package.json +4 -4
package/docs/features.md
CHANGED
|
@@ -73,8 +73,8 @@ export function createFileClient(hostUrl: string, clientName: string): FileClien
|
|
|
73
73
|
ORM connection options for client-side database context usage.
|
|
74
74
|
|
|
75
75
|
```typescript
|
|
76
|
-
export interface OrmConnectOptions<
|
|
77
|
-
|
|
76
|
+
export interface OrmConnectOptions<T extends DbContext> {
|
|
77
|
+
DbClass: new (executor: DbContextExecutor, opt: { database: string; schema?: string }) => T;
|
|
78
78
|
connOpt: DbConnOptions & { configName: string };
|
|
79
79
|
dbContextOpt?: {
|
|
80
80
|
database: string;
|
|
@@ -85,7 +85,7 @@ export interface OrmConnectOptions<TDef extends DbContextDef<any, any, any>> {
|
|
|
85
85
|
|
|
86
86
|
| Field | Type | Description |
|
|
87
87
|
|-------|------|-------------|
|
|
88
|
-
| `
|
|
88
|
+
| `DbClass` | `new (executor: DbContextExecutor, opt: { database: string; schema?: string }) => T` | DbContext subclass constructor |
|
|
89
89
|
| `connOpt` | `DbConnOptions & { configName: string }` | Connection options with required config name |
|
|
90
90
|
| `dbContextOpt` | `{ database: string; schema: string }?` | Optional database/schema override |
|
|
91
91
|
|
|
@@ -95,21 +95,21 @@ ORM client connector that opens a database context over the service RPC layer.
|
|
|
95
95
|
|
|
96
96
|
```typescript
|
|
97
97
|
export interface OrmClientConnector {
|
|
98
|
-
connect<
|
|
99
|
-
config: OrmConnectOptions<
|
|
100
|
-
callback: (db:
|
|
98
|
+
connect<T extends DbContext, R>(
|
|
99
|
+
config: OrmConnectOptions<T>,
|
|
100
|
+
callback: (db: T) => Promise<R> | R,
|
|
101
101
|
): Promise<R>;
|
|
102
|
-
connectWithoutTransaction<
|
|
103
|
-
config: OrmConnectOptions<
|
|
104
|
-
callback: (db:
|
|
102
|
+
connectWithoutTransaction<T extends DbContext, R>(
|
|
103
|
+
config: OrmConnectOptions<T>,
|
|
104
|
+
callback: (db: T) => Promise<R> | R,
|
|
105
105
|
): Promise<R>;
|
|
106
106
|
}
|
|
107
107
|
```
|
|
108
108
|
|
|
109
109
|
| Method | Parameters | Return | Description |
|
|
110
110
|
|--------|-----------|--------|-------------|
|
|
111
|
-
| `connect` | `config: OrmConnectOptions<
|
|
112
|
-
| `connectWithoutTransaction` | `config: OrmConnectOptions<
|
|
111
|
+
| `connect` | `config: OrmConnectOptions<T>, callback: (db: T) => Promise<R> \| R` | `Promise<R>` | Opens a DB context with automatic transaction (begin/commit/rollback). Wraps foreign key constraint errors with a user-friendly message |
|
|
112
|
+
| `connectWithoutTransaction` | `config: OrmConnectOptions<T>, callback: (db: T) => Promise<R> \| R` | `Promise<R>` | Opens a DB context without automatic transaction management |
|
|
113
113
|
|
|
114
114
|
## `createOrmClientConnector`
|
|
115
115
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simplysm/service-client",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.19",
|
|
4
4
|
"description": "심플리즘 패키지 - 서비스 (client)",
|
|
5
5
|
"author": "심플리즘",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"sideEffects": false,
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"consola": "^3.4.2",
|
|
23
|
-
"@simplysm/core-common": "14.0.
|
|
24
|
-
"@simplysm/service-common": "14.0.
|
|
25
|
-
"@simplysm/orm-common": "14.0.
|
|
23
|
+
"@simplysm/core-common": "14.0.19",
|
|
24
|
+
"@simplysm/service-common": "14.0.19",
|
|
25
|
+
"@simplysm/orm-common": "14.0.19"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/ws": "^8.18.1",
|