baja-lite 1.0.22 → 1.0.23
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/cjs/sql.d.ts +6 -0
- package/cjs/sql.js +16 -0
- package/es/sql.d.ts +6 -0
- package/es/sql.js +16 -0
- package/package.json +1 -1
- package/src/sql.ts +13 -0
package/cjs/sql.d.ts
CHANGED
|
@@ -1328,6 +1328,12 @@ export declare class SqlService<T extends object> {
|
|
|
1328
1328
|
sync: SyncMode.Sync;
|
|
1329
1329
|
force?: boolean;
|
|
1330
1330
|
}): void;
|
|
1331
|
+
close(option?: MethodOption & {
|
|
1332
|
+
sync?: SyncMode.Async;
|
|
1333
|
+
}): Promise<void>;
|
|
1334
|
+
close(option: MethodOption & {
|
|
1335
|
+
sync: SyncMode.Sync;
|
|
1336
|
+
}): void;
|
|
1331
1337
|
/**
|
|
1332
1338
|
#创建表
|
|
1333
1339
|
** `tableName` 表名称
|
package/cjs/sql.js
CHANGED
|
@@ -3162,6 +3162,16 @@ class SqlService {
|
|
|
3162
3162
|
});
|
|
3163
3163
|
}
|
|
3164
3164
|
}
|
|
3165
|
+
close(option) {
|
|
3166
|
+
const dbName = option?.dbName ?? this[_daoDBName] ?? exports._primaryDB;
|
|
3167
|
+
delete globalThis[exports._dao][this[_dbType]][dbName];
|
|
3168
|
+
if (option?.sync === SyncMode.Async) {
|
|
3169
|
+
return option.dao.close(SyncMode.Async);
|
|
3170
|
+
}
|
|
3171
|
+
else if (option?.sync === SyncMode.Sync) {
|
|
3172
|
+
option.dao.close(SyncMode.Sync);
|
|
3173
|
+
}
|
|
3174
|
+
}
|
|
3165
3175
|
/**
|
|
3166
3176
|
#创建表
|
|
3167
3177
|
** `tableName` 表名称
|
|
@@ -3323,6 +3333,12 @@ __decorate([
|
|
|
3323
3333
|
__metadata("design:paramtypes", [Object]),
|
|
3324
3334
|
__metadata("design:returntype", Object)
|
|
3325
3335
|
], SqlService.prototype, "init", null);
|
|
3336
|
+
__decorate([
|
|
3337
|
+
P(),
|
|
3338
|
+
__metadata("design:type", Function),
|
|
3339
|
+
__metadata("design:paramtypes", [Object]),
|
|
3340
|
+
__metadata("design:returntype", Object)
|
|
3341
|
+
], SqlService.prototype, "close", null);
|
|
3326
3342
|
/** 是否进行下一个动作 */
|
|
3327
3343
|
const IF_PROCEED = function () {
|
|
3328
3344
|
return function (_target, _propertyKey, descriptor) {
|
package/es/sql.d.ts
CHANGED
|
@@ -1328,6 +1328,12 @@ export declare class SqlService<T extends object> {
|
|
|
1328
1328
|
sync: SyncMode.Sync;
|
|
1329
1329
|
force?: boolean;
|
|
1330
1330
|
}): void;
|
|
1331
|
+
close(option?: MethodOption & {
|
|
1332
|
+
sync?: SyncMode.Async;
|
|
1333
|
+
}): Promise<void>;
|
|
1334
|
+
close(option: MethodOption & {
|
|
1335
|
+
sync: SyncMode.Sync;
|
|
1336
|
+
}): void;
|
|
1331
1337
|
/**
|
|
1332
1338
|
#创建表
|
|
1333
1339
|
** `tableName` 表名称
|
package/es/sql.js
CHANGED
|
@@ -3116,6 +3116,16 @@ export class SqlService {
|
|
|
3116
3116
|
});
|
|
3117
3117
|
}
|
|
3118
3118
|
}
|
|
3119
|
+
close(option) {
|
|
3120
|
+
const dbName = option?.dbName ?? this[_daoDBName] ?? _primaryDB;
|
|
3121
|
+
delete globalThis[_dao][this[_dbType]][dbName];
|
|
3122
|
+
if (option?.sync === SyncMode.Async) {
|
|
3123
|
+
return option.dao.close(SyncMode.Async);
|
|
3124
|
+
}
|
|
3125
|
+
else if (option?.sync === SyncMode.Sync) {
|
|
3126
|
+
option.dao.close(SyncMode.Sync);
|
|
3127
|
+
}
|
|
3128
|
+
}
|
|
3119
3129
|
/**
|
|
3120
3130
|
#创建表
|
|
3121
3131
|
** `tableName` 表名称
|
|
@@ -3276,6 +3286,12 @@ __decorate([
|
|
|
3276
3286
|
__metadata("design:paramtypes", [Object]),
|
|
3277
3287
|
__metadata("design:returntype", Object)
|
|
3278
3288
|
], SqlService.prototype, "init", null);
|
|
3289
|
+
__decorate([
|
|
3290
|
+
P(),
|
|
3291
|
+
__metadata("design:type", Function),
|
|
3292
|
+
__metadata("design:paramtypes", [Object]),
|
|
3293
|
+
__metadata("design:returntype", Object)
|
|
3294
|
+
], SqlService.prototype, "close", null);
|
|
3279
3295
|
/** 是否进行下一个动作 */
|
|
3280
3296
|
const IF_PROCEED = function () {
|
|
3281
3297
|
return function (_target, _propertyKey, descriptor) {
|
package/package.json
CHANGED
package/src/sql.ts
CHANGED
|
@@ -3695,6 +3695,19 @@ export class SqlService<T extends object> {
|
|
|
3695
3695
|
}
|
|
3696
3696
|
}
|
|
3697
3697
|
|
|
3698
|
+
close(option?: MethodOption & { sync?: SyncMode.Async; }): Promise<void>;
|
|
3699
|
+
close(option: MethodOption & { sync: SyncMode.Sync; }): void;
|
|
3700
|
+
@P<T>()
|
|
3701
|
+
close(option?: MethodOption & { sync?: SyncMode; force?: boolean }): void | Promise<void> {
|
|
3702
|
+
const dbName = option?.dbName ?? this[_daoDBName] ?? _primaryDB;
|
|
3703
|
+
delete globalThis[_dao][this[_dbType]!][dbName];
|
|
3704
|
+
if (option?.sync === SyncMode.Async) {
|
|
3705
|
+
return option!.dao!.close(SyncMode.Async);
|
|
3706
|
+
} else if (option?.sync === SyncMode.Sync) {
|
|
3707
|
+
option!.dao!.close(SyncMode.Sync)
|
|
3708
|
+
}
|
|
3709
|
+
}
|
|
3710
|
+
|
|
3698
3711
|
/**
|
|
3699
3712
|
#创建表
|
|
3700
3713
|
** `tableName` 表名称
|