baja-lite 1.4.4 → 1.4.6

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 CHANGED
@@ -1,8 +1,20 @@
1
1
  import { DBType, _Hump, getEnums } from 'baja-lite-field';
2
2
  import { ColumnMode, SqlCache, SqliteRemote, _GlobalSqlOption, _dao, _defOption, _enum, _primaryDB, _sqlCache, logger } from './sql.js';
3
3
  export const BootRomote = async function (options) {
4
- globalThis[_GlobalSqlOption] = Object.assign({}, _defOption, options);
5
- globalThis[_Hump] = globalThis[_GlobalSqlOption].columnMode === ColumnMode.HUMP;
4
+ globalThis[_GlobalSqlOption] = Object.assign({}, _defOption);
5
+ if (options.skipEmptyString !== undefined) {
6
+ globalThis[_GlobalSqlOption].skipEmptyString = options.skipEmptyString;
7
+ }
8
+ if (options.skipNull !== undefined) {
9
+ globalThis[_GlobalSqlOption].skipNull = options.skipNull;
10
+ }
11
+ if (options.skipEmptyString !== undefined) {
12
+ globalThis[_GlobalSqlOption].skipEmptyString = options.skipEmptyString;
13
+ }
14
+ if (options.maxDeal !== undefined) {
15
+ globalThis[_GlobalSqlOption].maxDeal = options.maxDeal;
16
+ }
17
+ globalThis[_Hump] = options.columnMode === ColumnMode.HUMP;
6
18
  logger.level = options.log ?? 'info';
7
19
  globalThis[_sqlCache] = new SqlCache();
8
20
  if (options.sqlMap) {
package/boot.js CHANGED
@@ -2,8 +2,20 @@ import { _Hump, DBType, getEnums } from 'baja-lite-field';
2
2
  import events from 'events';
3
3
  import { _dao, _defOption, _enum, _EventBus, _fs, _GlobalSqlOption, _path, _primaryDB, _sqlCache, ColumnMode, logger, Mysql, Postgresql, SqlCache, Sqlite, SqliteRemote } from './sql.js';
4
4
  export const Boot = async function (options) {
5
- globalThis[_GlobalSqlOption] = Object.assign({}, _defOption, options);
6
- globalThis[_Hump] = globalThis[_GlobalSqlOption].columnMode === ColumnMode.HUMP;
5
+ globalThis[_GlobalSqlOption] = Object.assign({}, _defOption);
6
+ if (options.skipEmptyString !== undefined) {
7
+ globalThis[_GlobalSqlOption].skipEmptyString = options.skipEmptyString;
8
+ }
9
+ if (options.skipNull !== undefined) {
10
+ globalThis[_GlobalSqlOption].skipNull = options.skipNull;
11
+ }
12
+ if (options.skipEmptyString !== undefined) {
13
+ globalThis[_GlobalSqlOption].skipEmptyString = options.skipEmptyString;
14
+ }
15
+ if (options.maxDeal !== undefined) {
16
+ globalThis[_GlobalSqlOption].maxDeal = options.maxDeal;
17
+ }
18
+ globalThis[_Hump] = options.columnMode === ColumnMode.HUMP;
7
19
  if (options.sqlDir) {
8
20
  globalThis[_path] = await import('path');
9
21
  globalThis[_fs] = await import('fs');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baja-lite",
3
- "version": "1.4.4",
3
+ "version": "1.4.6",
4
4
  "description": "some util for self",
5
5
  "homepage": "https://github.com/void-soul/baja-lite",
6
6
  "repository": {
package/sql.js CHANGED
@@ -1463,7 +1463,7 @@ class Build {
1463
1463
  * * t.problemtype = 列名
1464
1464
  *
1465
1465
  * ```
1466
- * {{#enumTag}} PROBLEM_TYPE(t.problemtype) {{/enumTag}}
1466
+ * {{#enum}} PROBLEM_TYPE(t.problemtype) {{/enum}}
1467
1467
  * ```
1468
1468
  */
1469
1469
  enum() {
@@ -1826,8 +1826,8 @@ function P(skipConn = false) {
1826
1826
  resolve(result);
1827
1827
  }
1828
1828
  catch (error) {
1829
- // console.error(`service ${propertyKey} have an error:${error}, it's argumens: ${JSON.stringify(args.filter(i => typeof i !== 'object' || (typeof i === 'object' && !i.insert)))}`)
1830
- console.error(`${option.sqlId ?? option.tableName} service ${propertyKey} have an error:${error}`);
1829
+ console.error(`${option.sqlId ?? option.tableName} service ${propertyKey} have an error:${error}, it's argumens: ${JSON.stringify(args.filter(i => typeof i !== 'object' || (typeof i === 'object' && !i.insert)))}`);
1830
+ // console.error(`${(option as any).sqlId ?? option!.tableName} service ${propertyKey} have an error:${error}`)
1831
1831
  reject(error);
1832
1832
  }
1833
1833
  finally {
@@ -1857,8 +1857,8 @@ function P(skipConn = false) {
1857
1857
  resolve(result);
1858
1858
  }
1859
1859
  catch (error) {
1860
- // console.error(`service ${propertyKey} have an error:${error}, it's argumens: ${JSON.stringify(args.filter(i => typeof i !== 'object' || (typeof i === 'object' && !i.insert)))}`)
1861
- console.error(`${option.sqlId ?? option.tableName} service ${propertyKey} have an error:${error}`);
1860
+ console.error(`${option.sqlId ?? option.tableName} service ${propertyKey} have an error:${error}, it's argumens: ${JSON.stringify(args.filter(i => typeof i !== 'object' || (typeof i === 'object' && !i.insert)))}`);
1861
+ // console.error(`${(option as any).sqlId ?? option!.tableName} service ${propertyKey} have an error:${error}`)
1862
1862
  reject(error);
1863
1863
  }
1864
1864
  finally {
@@ -1888,8 +1888,8 @@ function P(skipConn = false) {
1888
1888
  resolve(result);
1889
1889
  }
1890
1890
  catch (error) {
1891
- //console.error(`service ${propertyKey} have an error:${error}, it's argumens: ${JSON.stringify(args.filter(i => typeof i !== 'object' || (typeof i === 'object' && !i.insert)))}`)
1892
- console.error(`${option.sqlId ?? option.tableName} service ${propertyKey} have an error:${error}`);
1891
+ console.error(`${option.sqlId ?? option.tableName} service ${propertyKey} have an error:${error}, it's argumens: ${JSON.stringify(args.filter(i => typeof i !== 'object' || (typeof i === 'object' && !i.insert)))}`);
1892
+ // console.error(`${(option as any).sqlId ?? option!.tableName} service ${propertyKey} have an error:${error}`)
1893
1893
  reject(error);
1894
1894
  }
1895
1895
  finally {