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.
- package/db.js +4 -4
- 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
|
|
838
|
-
throw new TypeError('table, model
|
|
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
|
|
842
|
-
const value = model
|
|
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';
|