baja-lite 1.3.30 → 1.3.31
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/boot-remote.js +2 -2
- package/boot.js +2 -2
- package/package.json +2 -2
- package/sql.d.ts +1 -1
- package/sql.js +2 -2
package/boot-remote.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DBType, _Hump, getEnums } from 'baja-lite-field';
|
|
2
|
-
import { ColumnMode, SqlCache, SqliteRemote, _GlobalSqlOption, _dao, _defOption,
|
|
2
|
+
import { ColumnMode, SqlCache, SqliteRemote, _GlobalSqlOption, _dao, _defOption, _enum, _primaryDB, _sqlCache, logger } from './sql.js';
|
|
3
3
|
export const BootRomote = async function (options) {
|
|
4
4
|
globalThis[_GlobalSqlOption] = Object.assign({}, _defOption, options);
|
|
5
5
|
globalThis[_Hump] = globalThis[_GlobalSqlOption].columnMode === ColumnMode.HUMP;
|
|
@@ -12,7 +12,7 @@ export const BootRomote = async function (options) {
|
|
|
12
12
|
[DBType.SqliteRemote]: {},
|
|
13
13
|
};
|
|
14
14
|
if (options.enums) {
|
|
15
|
-
globalThis[
|
|
15
|
+
globalThis[_enum] = getEnums(options.enums);
|
|
16
16
|
}
|
|
17
17
|
if (options.SqliteRemote && options.SqliteRemote.db) {
|
|
18
18
|
if (typeof options.SqliteRemote.db === 'string') {
|
package/boot.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _Hump, DBType, getEnums } from 'baja-lite-field';
|
|
2
|
-
import { _dao, _defOption,
|
|
2
|
+
import { _dao, _defOption, _enum, _EventBus, _fs, _GlobalSqlOption, _path, _primaryDB, _sqlCache, ColumnMode, logger, Mysql, Postgresql, SqlCache, Sqlite, SqliteRemote } from './sql.js';
|
|
3
3
|
export const Boot = async function (options) {
|
|
4
4
|
globalThis[_GlobalSqlOption] = Object.assign({}, _defOption, options);
|
|
5
5
|
globalThis[_Hump] = globalThis[_GlobalSqlOption].columnMode === ColumnMode.HUMP;
|
|
@@ -21,7 +21,7 @@ export const Boot = async function (options) {
|
|
|
21
21
|
[DBType.Redis]: {}
|
|
22
22
|
};
|
|
23
23
|
if (options.enums) {
|
|
24
|
-
globalThis[
|
|
24
|
+
globalThis[_enum] = getEnums(options.enums);
|
|
25
25
|
}
|
|
26
26
|
if (options.Mysql) {
|
|
27
27
|
const { createPool } = await import('mysql2/promise');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "baja-lite",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.31",
|
|
4
4
|
"description": "some util for self",
|
|
5
5
|
"homepage": "https://github.com/void-soul/util-man",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@msgpack/msgpack": "3.1.1",
|
|
39
39
|
"@types/request-promise": "4.1.51",
|
|
40
40
|
"axios": "1.8.4",
|
|
41
|
-
"baja-lite-field": "1.3.
|
|
41
|
+
"baja-lite-field": "1.3.31",
|
|
42
42
|
"decimal.js": "10.5.0",
|
|
43
43
|
"html-parse-stringify": "3.0.1",
|
|
44
44
|
"iterare": "1.2.1",
|
package/sql.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare const _inTransaction: unique symbol;
|
|
|
20
20
|
declare const _daoDB: unique symbol;
|
|
21
21
|
declare const _sqliteRemoteName: unique symbol;
|
|
22
22
|
declare const _SqlOption: unique symbol;
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const _enum: unique symbol;
|
|
24
24
|
export declare const _GlobalSqlOption: unique symbol;
|
|
25
25
|
export declare const _EventBus: unique symbol;
|
|
26
26
|
export declare const _path: unique symbol;
|
package/sql.js
CHANGED
|
@@ -72,7 +72,7 @@ const _sqliteRemoteName = Symbol('sqliteRemoteName');
|
|
|
72
72
|
const _SqlOption = Symbol('SqlOption');
|
|
73
73
|
const _resultMap = Symbol('resultMap');
|
|
74
74
|
const _resultMap_SQLID = Symbol('resultMap_SQLID');
|
|
75
|
-
export const
|
|
75
|
+
export const _enum = Symbol('_enum');
|
|
76
76
|
export const _GlobalSqlOption = Symbol('GlobalSqlOption');
|
|
77
77
|
export const _EventBus = Symbol('EventBus');
|
|
78
78
|
export const _path = Symbol('path');
|
|
@@ -1462,7 +1462,7 @@ class Build {
|
|
|
1462
1462
|
if (matchs) {
|
|
1463
1463
|
const [_a, MapName, Column] = matchs;
|
|
1464
1464
|
if (MapName && Column) {
|
|
1465
|
-
const map = globalThis[
|
|
1465
|
+
const map = globalThis[_enum].EnumMap(MapName.trim());
|
|
1466
1466
|
if (map) {
|
|
1467
1467
|
return ` CASE
|
|
1468
1468
|
${Object.entries(map).map(([k, v]) => `WHEN ${Column} = '${k}' THEN '${v}'`).join(' ')}
|