mm_sqlite 1.2.8 → 1.2.9
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/index.js +3 -3
- package/package.json +1 -1
- package/sql.js +0 -7
- package/backup/test_backup.sql +0 -6
- package/backup/test_backup1.sql +0 -5
- package/backup/test_backup2.sql +0 -7
package/index.js
CHANGED
|
@@ -13,7 +13,7 @@ class SQLite extends Base {
|
|
|
13
13
|
/**
|
|
14
14
|
* 默认配置
|
|
15
15
|
*/
|
|
16
|
-
static
|
|
16
|
+
static config = {
|
|
17
17
|
dir: './db/'.fullname(),
|
|
18
18
|
user: 'root',
|
|
19
19
|
password: '',
|
|
@@ -23,7 +23,7 @@ class SQLite extends Base {
|
|
|
23
23
|
connect_timeout: 20000,
|
|
24
24
|
acquire_timeout: 20000,
|
|
25
25
|
query_timeout: 20000,
|
|
26
|
-
connection_limit:
|
|
26
|
+
connection_limit: 500,
|
|
27
27
|
queue_limit: 0,
|
|
28
28
|
enable_keep_alive: true,
|
|
29
29
|
keep_alive_initial_delay: 10000,
|
|
@@ -44,7 +44,7 @@ class SQLite extends Base {
|
|
|
44
44
|
* @param {object} config - 配置对象
|
|
45
45
|
*/
|
|
46
46
|
constructor(config) {
|
|
47
|
-
const merged_cfg = { ...SQLite.
|
|
47
|
+
const merged_cfg = { ...SQLite.config, ...config || {}};
|
|
48
48
|
super(merged_cfg);
|
|
49
49
|
|
|
50
50
|
this.config = merged_cfg;
|
package/package.json
CHANGED
package/sql.js
CHANGED
|
@@ -974,13 +974,6 @@ Sql.prototype.get = async function (query, sort, view, like, timeout = 30000) {
|
|
|
974
974
|
}
|
|
975
975
|
};
|
|
976
976
|
|
|
977
|
-
/**
|
|
978
|
-
* @description 添加或修改
|
|
979
|
-
* @param {object} where 查询条件集合
|
|
980
|
-
* @param {object} set 修改的键值
|
|
981
|
-
* @param {boolean} like 是否使用like匹配, 默认不使用
|
|
982
|
-
* @returns {Promise | object} 执行结果
|
|
983
|
-
*/
|
|
984
977
|
/**
|
|
985
978
|
* 添加或修改数据(存在则修改,不存在则添加)
|
|
986
979
|
* @param {object | string} where 查询条件
|
package/backup/test_backup.sql
DELETED
package/backup/test_backup1.sql
DELETED
package/backup/test_backup2.sql
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
-- 备份表: test_table
|
|
2
|
-
-- 备份时间: 2025-12-25T15:56:50.301Z
|
|
3
|
-
|
|
4
|
-
CREATE TABLE IF NOT EXISTS `test_table` (`id` INTEGER PRIMARY KEY, `name` TEXT, `age` INTEGER);
|
|
5
|
-
|
|
6
|
-
INSERT INTO `test_table` (`id`, `name`, `age`) VALUES (1, '测试数据1', 25);
|
|
7
|
-
INSERT INTO `test_table` (`id`, `name`, `age`) VALUES (2, '测试数据2', 30);
|