@adep/cli 0.1.6 → 0.1.8

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/dist/index.js +2894 -569
  2. package/dist/vite.js +11 -0
  3. package/package.json +1 -1
package/dist/vite.js CHANGED
@@ -1348,6 +1348,17 @@ var SimSqlEngine = class {
1348
1348
  }
1349
1349
  return { changes: 0 };
1350
1350
  }
1351
+ if (/^CREATE\s+(?:UNIQUE\s+)?INDEX\s+(?:IF\s+NOT\s+EXISTS\s+)?/i.test(stmt)) {
1352
+ const idx = /^CREATE\s+(?:UNIQUE\s+)?INDEX\s+(?:IF\s+NOT\s+EXISTS\s+)?((?:"[^"]+")|([A-Za-z_][A-Za-z0-9_]*))\s+ON\s+((?:"[^"]+")|([A-Za-z_][A-Za-z0-9_]*))/i.exec(
1353
+ stmt
1354
+ );
1355
+ if (idx === null) throw new SimDbError("DB_UNSAFE_OP", `\u65E0\u6CD5\u89E3\u6790 CREATE INDEX \u8BED\u53E5`);
1356
+ const tableName = ident(idx[3]);
1357
+ if (this.tables[tableName] === void 0) {
1358
+ throw new SimDbError("DB_UNSAFE_OP", `CREATE INDEX \u76EE\u6807\u8868\u4E0D\u5B58\u5728\uFF1A${tableName}`);
1359
+ }
1360
+ return { changes: 0 };
1361
+ }
1351
1362
  if (/^INSERT\s+INTO/i.test(stmt)) return this.execInsert(stmt, params);
1352
1363
  if (/^UPDATE\s+/i.test(stmt)) return this.execUpdate(stmt, params);
1353
1364
  if (/^DELETE\s+FROM/i.test(stmt)) return this.execDelete(stmt, params);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adep/cli",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "type": "module",
5
5
  "description": "`adep` 命令行工具包位:登录 / 初始化 / 本地调试 / 部署 / 数据库维护 / 云存储 / 静态托管 / 微前端组件(widget),实现见任务单 CLI-001 ~ CLI-003 与 FE-002;子路径 `@adep/cli/vite` 提供云函数 vite 插件(CLI-014)",
6
6
  "bin": {