mm_sqlite 1.2.0 → 1.2.2

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 (2) hide show
  1. package/db.js +4 -4
  2. package/package.json +1 -1
package/db.js CHANGED
@@ -834,12 +834,12 @@ DB.prototype.backup = function (table, backup, timeout = 60000) {
834
834
  * @return {Promise|Number} 操作结果
835
835
  */
836
836
  DB.prototype.createTable = function (table, model, key = 'id', timeout = 15000) {
837
- if (!table || !model || !model.fields) {
838
- throw new TypeError('table, model, and model.fields must be specified');
837
+ if (!table || !model) {
838
+ throw new TypeError('table, model must be specified');
839
839
  }
840
840
  var fields = '';
841
- for (const field in model.fields) {
842
- const value = model.fields[field];
841
+ for (const field in model) {
842
+ const value = model[field];
843
843
  let type = '';
844
844
  if (field === key) {
845
845
  type = 'INTEGER PRIMARY KEY AUTOINCREMENT';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_sqlite",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "高性能SQLite数据库操作模块,提供与mm_mysql完全兼容的API接口,支持异步操作、事务处理和批量操作",
5
5
  "main": "index.js",
6
6
  "scripts": {