@nocobase/database 0.21.0-alpha.7 → 0.21.0-alpha.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.
@@ -35,8 +35,8 @@ var import_lodash = __toESM(require("lodash"));
35
35
  var import_sequelize = require("sequelize");
36
36
  var import_utils = require("./utils");
37
37
  const getFieldName = /* @__PURE__ */ __name((ctx) => {
38
- const fieldName = ctx.fieldName;
39
- return fieldName;
38
+ var _a;
39
+ return ((_a = ctx.model.rawAttributes[ctx.fieldName]) == null ? void 0 : _a.field) || ctx.fieldName;
40
40
  }, "getFieldName");
41
41
  const escape = /* @__PURE__ */ __name((value, ctx) => {
42
42
  const sequelize = ctx.db.sequelize;
@@ -64,10 +64,12 @@ const emptyQuery = /* @__PURE__ */ __name((ctx, operator) => {
64
64
  if ((0, import_utils.isMySQL)(ctx)) {
65
65
  funcName = "json_length";
66
66
  }
67
- return `(select ${ifNull}(${funcName}(${fieldName}), 0) ${operator} 0)`;
67
+ const queryInterface = getQueryInterface(ctx);
68
+ return `(select ${ifNull}(${funcName}(${queryInterface.quoteIdentifier(fieldName)}), 0) ${operator} 0)`;
68
69
  }, "emptyQuery");
69
70
  var array_default = {
70
71
  $match(value, ctx) {
72
+ const queryInterface = getQueryInterface(ctx);
71
73
  const fieldName = getFieldName(ctx);
72
74
  if ((0, import_utils.isPg)(ctx)) {
73
75
  const name = ctx.fullName === fieldName ? `"${ctx.model.name}"."${fieldName}"` : `"${fieldName}"`;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nocobase/database",
3
- "version": "0.21.0-alpha.7",
3
+ "version": "0.21.0-alpha.8",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
7
7
  "license": "Apache-2.0",
8
8
  "dependencies": {
9
- "@nocobase/logger": "0.21.0-alpha.7",
10
- "@nocobase/utils": "0.21.0-alpha.7",
9
+ "@nocobase/logger": "0.21.0-alpha.8",
10
+ "@nocobase/utils": "0.21.0-alpha.8",
11
11
  "async-mutex": "^0.3.2",
12
12
  "chalk": "^4.1.1",
13
13
  "cron-parser": "4.4.0",
@@ -36,5 +36,5 @@
36
36
  "url": "git+https://github.com/nocobase/nocobase.git",
37
37
  "directory": "packages/database"
38
38
  },
39
- "gitHead": "b1be3993f8aa81173d01bc390aa8e4c5adcc0e2d"
39
+ "gitHead": "bed69485709bc8e268285b50debfc1ebfd7a30c7"
40
40
  }