mm_sqlite 1.2.3 → 1.2.5

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.
Files changed (3) hide show
  1. package/db.js +4 -4
  2. package/index.js +1 -1
  3. package/package.json +1 -1
package/db.js CHANGED
@@ -7,11 +7,11 @@ const { Sql } = require('./sql');
7
7
  class DB extends Sql {
8
8
  /**
9
9
  * @description 数据库管理器
10
- * @param {object} mysql MySQL实例
10
+ * @param {object} sqlite sqlite实例
11
11
  */
12
12
  constructor(sqlite) {
13
13
  super(sqlite.run, sqlite.exec);
14
- // 保存mysql实例引用
14
+ // 保存sqlite实例引用
15
15
  this._sqlite = sqlite;
16
16
  // 事务中
17
17
  this.task = 0;
@@ -77,13 +77,13 @@ DB.prototype.new = function (table, key) {
77
77
  * @returns {Promise<object>} 数据库连接对象
78
78
  */
79
79
  DB.prototype.getConn = async function (timeout = 15000) {
80
- if (!this._mysql) {
80
+ if (!this._sqlite) {
81
81
  throw new Error('SQLite实例未初始化');
82
82
  }
83
83
  try {
84
84
  // 使用Promise.race实现超时控制
85
85
  return await Promise.race([
86
- this._mysql.getConn(),
86
+ this._sqlite.getConn(),
87
87
  this._createTimeoutPromise(timeout, '获取数据库连接超时')
88
88
  ]);
89
89
  } catch (error) {
package/index.js CHANGED
@@ -897,7 +897,7 @@ function sqliteAdmin(scope, config) {
897
897
  }
898
898
  var obj = $.pool.sqlite[scope];
899
899
  if (!obj) {
900
- $.pool.sqlite[scope] = new Sqlite(config);
900
+ $.pool.sqlite[scope] = new SQLite(config);
901
901
  obj = $.pool.sqlite[scope];
902
902
  }
903
903
  return obj;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_sqlite",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "高性能SQLite数据库操作模块,提供与mm_mysql完全兼容的API接口,支持异步操作、事务处理和批量操作",
5
5
  "main": "index.js",
6
6
  "scripts": {