baja-lite 1.3.51 → 1.3.52
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/code.js +7 -5
- package/package.json +1 -1
- package/sql.js +8 -8
package/code.js
CHANGED
|
@@ -104,7 +104,7 @@ console.log(`
|
|
|
104
104
|
splitName // 字符串,event/main/info
|
|
105
105
|
SplitName // 字符串,event/mainInfo
|
|
106
106
|
|
|
107
|
-
columns // 数组, 元素格式为{comment:注释,name: sku_id,Name: skuId,NAME: SkuId,Field:表示字段的注解,Type:表示JS类型}
|
|
107
|
+
columns // 数组, 元素格式为{comment:注释,name: sku_id,Name: skuId,NAME: SkuId,Field:表示字段的注解,JSField_name, JSFieldName 分别表示JS的注解,Type:表示JS类型}
|
|
108
108
|
column_names // 数组, 元素是列名字符串,格式是 sku_id,sku_name
|
|
109
109
|
ColumnNames // 数组, 元素是列名字符串,格式是 skuId,skuName
|
|
110
110
|
column_names_join // 字符串,列名join的字符串,格式是 "sku_id,sku_name"
|
|
@@ -113,20 +113,20 @@ console.log(`
|
|
|
113
113
|
column_names_joinT // 字符串,列名join的字符串,格式是 "t.sku_id,t.sku_name"
|
|
114
114
|
ColumnNames_joinT // 字符串,列名join的字符串,格式是 "t.skuId,t.skuName"
|
|
115
115
|
|
|
116
|
-
columns_no_id // 数组, 不含主键, 元素格式为{comment:注释,name: sku_id,Name: skuId,NAME: SkuId,Field:表示字段的注解,Type:表示JS类型}
|
|
116
|
+
columns_no_id // 数组, 不含主键, 元素格式为{comment:注释,name: sku_id,Name: skuId,NAME: SkuId,Field:表示字段的注解,JSField_name, JSFieldName 分别表示JS的注解,Type:表示JS类型}
|
|
117
117
|
column_names_no_id // 数组, 不含主键, 元素是列名字符串,格式是 sku_id,sku_name
|
|
118
118
|
ColumnNames_no_id // 数组, 不含主键, 元素是列名字符串,格式是 skuId,skuName
|
|
119
119
|
column_names_no_id_join // 字符串, 不含主键, 列名join的字符串,格式是 "sku_id,sku_name"
|
|
120
120
|
ColumnNames_no_id_join // 字符串, 不含主键, 列名join的字符串,格式是 "skuId,skuName"
|
|
121
121
|
|
|
122
122
|
|
|
123
|
-
columns_no_skip // 数组, 不含跳过的列,元素格式为{comment:注释,name: sku_id,Name: skuId,NAME: SkuId,Field:表示字段的注解,Type:表示JS类型}
|
|
123
|
+
columns_no_skip // 数组, 不含跳过的列,元素格式为{comment:注释,name: sku_id,Name: skuId,NAME: SkuId,Field:表示字段的注解,JSField_name, JSFieldName 分别表示JS的注解,Type:表示JS类型}
|
|
124
124
|
column_names_no_skip // 数组, 不含跳过的列, 元素是列名字符串,格式是 sku_id,sku_name
|
|
125
125
|
ColumnNames_no_skip // 数组, 不含跳过的列, 元素是列名字符串,格式是 skuId,skuName
|
|
126
126
|
column_names_no_skip_join // 数组, 不含跳过的列, 元素是列名字符串,格式是 "sku_id,sku_name"
|
|
127
127
|
ColumnNames_no_skip_join // 数组, 不含跳过的列, 元素是列名字符串,格式是 "skuId,skuName"
|
|
128
128
|
|
|
129
|
-
ids // 数组, 只有主键, 元素格式为{comment:注释,name: sku_id,Name: skuId,NAME: SkuId,Field:表示字段的注解,Type:表示JS类型}
|
|
129
|
+
ids // 数组, 只有主键, 元素格式为{comment:注释,name: sku_id,Name: skuId,NAME: SkuId,Field:表示字段的注解,JSField_name, JSFieldName 分别表示JS的注解,Type:表示JS类型}
|
|
130
130
|
id_names // 数组, 只有主键, 元素是列名字符串,格式是 sku_id,sku_name
|
|
131
131
|
IdNames // 数组, 只有主键, 元素是列名字符串,格式是 skuId,skuName
|
|
132
132
|
id_names_join // 字符串,列名join的字符串,格式是 "sku_id,sku_name"
|
|
@@ -262,9 +262,11 @@ try {
|
|
|
262
262
|
fields.push(`comment: '${r.comment}'`);
|
|
263
263
|
}
|
|
264
264
|
r.comment = r.comment ?? '';
|
|
265
|
-
r.Field = `@Field({${fields.join(',')}})`;
|
|
266
265
|
r.Name = r.name.replace(/_(\w)/g, (a, b) => b.toUpperCase());
|
|
267
266
|
r.NAME = r.Name.replace(/\w/, (v) => v.toUpperCase());
|
|
267
|
+
r.Field = `@Field({${fields.join(',')}})`;
|
|
268
|
+
r.JSField_name = `{${fields.join(',')}, P: '${r.name}'}`;
|
|
269
|
+
r.JSFieldName = `{${fields.join(',')}, P: '${r.Name}'}`;
|
|
268
270
|
return r;
|
|
269
271
|
});
|
|
270
272
|
conn.release();
|
package/package.json
CHANGED
package/sql.js
CHANGED
|
@@ -1771,7 +1771,7 @@ function P(skipConn = false) {
|
|
|
1771
1771
|
}
|
|
1772
1772
|
try {
|
|
1773
1773
|
const result = fn.call(this, ...args);
|
|
1774
|
-
logger.info(`${propertyKey}:${option.tableName}:use ${+new Date() - startTime}ms`);
|
|
1774
|
+
logger.info(`${propertyKey}:${option.sqlId ?? option.tableName}:use ${+new Date() - startTime}ms`);
|
|
1775
1775
|
return result;
|
|
1776
1776
|
}
|
|
1777
1777
|
catch (error) {
|
|
@@ -1779,7 +1779,7 @@ function P(skipConn = false) {
|
|
|
1779
1779
|
console.error(`service ${propertyKey} have an error:${error}`);
|
|
1780
1780
|
}
|
|
1781
1781
|
catch (error) {
|
|
1782
|
-
console.error(`${option.tableName} service ${propertyKey} have an error:${error}`);
|
|
1782
|
+
console.error(`${option.sqlId ?? option.tableName} service ${propertyKey} have an error:${error}`);
|
|
1783
1783
|
}
|
|
1784
1784
|
throw error;
|
|
1785
1785
|
}
|
|
@@ -1814,12 +1814,12 @@ function P(skipConn = false) {
|
|
|
1814
1814
|
}
|
|
1815
1815
|
try {
|
|
1816
1816
|
const result = await fn.call(this, ...args);
|
|
1817
|
-
logger.info(`${propertyKey}:${option.tableName}:use ${+new Date() - startTime}ms`);
|
|
1817
|
+
logger.info(`${propertyKey}:${option.sqlId ?? option.tableName}:use ${+new Date() - startTime}ms`);
|
|
1818
1818
|
resolve(result);
|
|
1819
1819
|
}
|
|
1820
1820
|
catch (error) {
|
|
1821
1821
|
// console.error(`service ${propertyKey} have an error:${error}, it's argumens: ${JSON.stringify(args.filter(i => typeof i !== 'object' || (typeof i === 'object' && !i.insert)))}`)
|
|
1822
|
-
console.error(`${option.tableName} service ${propertyKey} have an error:${error}`);
|
|
1822
|
+
console.error(`${option.sqlId ?? option.tableName} service ${propertyKey} have an error:${error}`);
|
|
1823
1823
|
reject(error);
|
|
1824
1824
|
}
|
|
1825
1825
|
finally {
|
|
@@ -1845,12 +1845,12 @@ function P(skipConn = false) {
|
|
|
1845
1845
|
needRealseConn = false;
|
|
1846
1846
|
}
|
|
1847
1847
|
const result = await fn.call(this, ...args);
|
|
1848
|
-
logger.info(`${propertyKey}:${option.tableName}:use ${+new Date() - startTime}ms`);
|
|
1848
|
+
logger.info(`${propertyKey}:${option.sqlId ?? option.tableName}:use ${+new Date() - startTime}ms`);
|
|
1849
1849
|
resolve(result);
|
|
1850
1850
|
}
|
|
1851
1851
|
catch (error) {
|
|
1852
1852
|
// console.error(`service ${propertyKey} have an error:${error}, it's argumens: ${JSON.stringify(args.filter(i => typeof i !== 'object' || (typeof i === 'object' && !i.insert)))}`)
|
|
1853
|
-
console.error(`${option.tableName} service ${propertyKey} have an error:${error}`);
|
|
1853
|
+
console.error(`${option.sqlId ?? option.tableName} service ${propertyKey} have an error:${error}`);
|
|
1854
1854
|
reject(error);
|
|
1855
1855
|
}
|
|
1856
1856
|
finally {
|
|
@@ -1876,12 +1876,12 @@ function P(skipConn = false) {
|
|
|
1876
1876
|
needRealseConn = false;
|
|
1877
1877
|
}
|
|
1878
1878
|
const result = await fn.call(this, ...args);
|
|
1879
|
-
logger.info(`${propertyKey}:${option.tableName}:use ${+new Date() - startTime}ms`);
|
|
1879
|
+
logger.info(`${propertyKey}:${option.sqlId ?? option.tableName}:use ${+new Date() - startTime}ms`);
|
|
1880
1880
|
resolve(result);
|
|
1881
1881
|
}
|
|
1882
1882
|
catch (error) {
|
|
1883
1883
|
//console.error(`service ${propertyKey} have an error:${error}, it's argumens: ${JSON.stringify(args.filter(i => typeof i !== 'object' || (typeof i === 'object' && !i.insert)))}`)
|
|
1884
|
-
console.error(`${option.tableName} service ${propertyKey} have an error:${error}`);
|
|
1884
|
+
console.error(`${option.sqlId ?? option.tableName} service ${propertyKey} have an error:${error}`);
|
|
1885
1885
|
reject(error);
|
|
1886
1886
|
}
|
|
1887
1887
|
finally {
|