@nocobase/database 1.6.24 → 1.6.26
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.
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import { DatabaseOptions } from '../database';
|
|
9
10
|
import { BaseDialect } from './base-dialect';
|
|
10
11
|
export declare class MariadbDialect extends BaseDialect {
|
|
11
12
|
static dialectName: string;
|
|
13
|
+
getSequelizeOptions(options: DatabaseOptions): import("../database").IDatabaseOptions;
|
|
12
14
|
getVersionGuard(): {
|
|
13
15
|
sql: string;
|
|
14
16
|
get: (v: string) => string;
|
|
@@ -34,6 +34,10 @@ __export(mariadb_dialect_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(mariadb_dialect_exports);
|
|
35
35
|
var import_base_dialect = require("./base-dialect");
|
|
36
36
|
const _MariadbDialect = class _MariadbDialect extends import_base_dialect.BaseDialect {
|
|
37
|
+
getSequelizeOptions(options) {
|
|
38
|
+
options.dialectOptions = { ...options.dialectOptions || {}, supportBigNumbers: true, bigNumberStrings: true };
|
|
39
|
+
return options;
|
|
40
|
+
}
|
|
37
41
|
getVersionGuard() {
|
|
38
42
|
return {
|
|
39
43
|
sql: "select version() as version",
|
|
@@ -40,10 +40,20 @@ const _StringField = class _StringField extends import_field.Field {
|
|
|
40
40
|
return import_sequelize.DataTypes.STRING;
|
|
41
41
|
}
|
|
42
42
|
additionalSequelizeOptions() {
|
|
43
|
-
const { name, trim } = this.options;
|
|
43
|
+
const { name, trim, unique } = this.options;
|
|
44
44
|
return {
|
|
45
45
|
set(value) {
|
|
46
|
-
|
|
46
|
+
if (unique && value === "") {
|
|
47
|
+
value = null;
|
|
48
|
+
}
|
|
49
|
+
if (value == null) {
|
|
50
|
+
this.setDataValue(name, null);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (typeof value !== "string") {
|
|
54
|
+
value = value.toString();
|
|
55
|
+
}
|
|
56
|
+
this.setDataValue(name, trim ? value.trim() : value);
|
|
47
57
|
}
|
|
48
58
|
};
|
|
49
59
|
}
|
package/lib/fields/text-field.js
CHANGED
|
@@ -45,10 +45,20 @@ const _TextField = class _TextField extends import_field.Field {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
additionalSequelizeOptions() {
|
|
48
|
-
const { name, trim } = this.options;
|
|
48
|
+
const { name, trim, unique } = this.options;
|
|
49
49
|
return {
|
|
50
50
|
set(value) {
|
|
51
|
-
|
|
51
|
+
if (unique && value === "") {
|
|
52
|
+
value = null;
|
|
53
|
+
}
|
|
54
|
+
if (value == null) {
|
|
55
|
+
this.setDataValue(name, null);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (typeof value !== "string") {
|
|
59
|
+
value = value.toString();
|
|
60
|
+
}
|
|
61
|
+
this.setDataValue(name, trim ? value.trim() : value);
|
|
52
62
|
}
|
|
53
63
|
};
|
|
54
64
|
}
|
package/lib/view-collection.js
CHANGED
|
@@ -44,7 +44,7 @@ const _ViewCollection = class _ViewCollection extends import_collection.Collecti
|
|
|
44
44
|
if (this.options.writableView) {
|
|
45
45
|
return [];
|
|
46
46
|
}
|
|
47
|
-
return ["create", "update", "destroy"];
|
|
47
|
+
return ["create", "update", "destroy", "importXlsx", "destroyMany", "updateMany"];
|
|
48
48
|
}
|
|
49
49
|
sequelizeModelOptions() {
|
|
50
50
|
const modelOptions = super.sequelizeModelOptions();
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/database",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.26",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
7
7
|
"license": "AGPL-3.0",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@nocobase/logger": "1.6.
|
|
10
|
-
"@nocobase/utils": "1.6.
|
|
9
|
+
"@nocobase/logger": "1.6.26",
|
|
10
|
+
"@nocobase/utils": "1.6.26",
|
|
11
11
|
"async-mutex": "^0.3.2",
|
|
12
12
|
"chalk": "^4.1.1",
|
|
13
13
|
"cron-parser": "4.4.0",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
39
39
|
"directory": "packages/database"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "dc7085b4f453983c6398a5b33011a8fb6dfc59ae"
|
|
42
42
|
}
|