@budibase/server 2.5.5-alpha.0 → 2.5.5-alpha.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/builder/assets/{index.c50f7af4.js → index.62f1f83f.js} +1 -1
- package/builder/index.html +1 -1
- package/dist/integrations/microsoftSqlServer.js +5 -2
- package/dist/integrations/mysql.js +5 -3
- package/dist/integrations/postgres.js +7 -5
- package/dist/package.json +7 -7
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/scripts/integrations/mssql/data/entrypoint.sh +1 -0
- package/scripts/integrations/mssql/data/setup.sql +17 -17
- package/scripts/integrations/mysql/init.sql +1 -1
- package/scripts/integrations/postgres/init.sql +1 -0
- package/src/integrations/microsoftSqlServer.ts +5 -2
- package/src/integrations/mysql.ts +5 -3
- package/src/integrations/postgres.ts +7 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.5.5-alpha.
|
|
4
|
+
"version": "2.5.5-alpha.2",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"license": "GPL-3.0",
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
48
|
-
"@budibase/backend-core": "2.5.5-alpha.
|
|
49
|
-
"@budibase/client": "2.5.5-alpha.
|
|
50
|
-
"@budibase/pro": "2.5.
|
|
51
|
-
"@budibase/shared-core": "2.5.5-alpha.
|
|
52
|
-
"@budibase/string-templates": "2.5.5-alpha.
|
|
53
|
-
"@budibase/types": "2.5.5-alpha.
|
|
48
|
+
"@budibase/backend-core": "2.5.5-alpha.2",
|
|
49
|
+
"@budibase/client": "2.5.5-alpha.2",
|
|
50
|
+
"@budibase/pro": "2.5.5-alpha.1",
|
|
51
|
+
"@budibase/shared-core": "2.5.5-alpha.2",
|
|
52
|
+
"@budibase/string-templates": "2.5.5-alpha.2",
|
|
53
|
+
"@budibase/types": "2.5.5-alpha.2",
|
|
54
54
|
"@bull-board/api": "3.7.0",
|
|
55
55
|
"@bull-board/koa": "3.9.4",
|
|
56
56
|
"@elastic/elasticsearch": "7.10.0",
|
|
@@ -176,5 +176,5 @@
|
|
|
176
176
|
"optionalDependencies": {
|
|
177
177
|
"oracledb": "5.3.0"
|
|
178
178
|
},
|
|
179
|
-
"gitHead": "
|
|
179
|
+
"gitHead": "696bf03033e57dae59175aae552fc2fd45cfd0cf"
|
|
180
180
|
}
|
|
@@ -34,7 +34,7 @@ GO
|
|
|
34
34
|
CREATE TABLE people
|
|
35
35
|
(
|
|
36
36
|
name varchar(30) NOT NULL,
|
|
37
|
-
age
|
|
37
|
+
age int default 20 NOT NULL,
|
|
38
38
|
CONSTRAINT pk_people PRIMARY KEY NONCLUSTERED (name, age)
|
|
39
39
|
);
|
|
40
40
|
|
|
@@ -50,22 +50,22 @@ VALUES
|
|
|
50
50
|
('Processing', 1);
|
|
51
51
|
|
|
52
52
|
INSERT INTO people (name, age)
|
|
53
|
-
VALUES ('Bob',
|
|
54
|
-
('Bert',
|
|
55
|
-
('Jack',
|
|
56
|
-
('Mike',
|
|
57
|
-
('Dave',
|
|
58
|
-
('Jim',
|
|
59
|
-
('Kerry',
|
|
60
|
-
('Julie',
|
|
61
|
-
('Kim',
|
|
62
|
-
('Andy',
|
|
63
|
-
('John',
|
|
64
|
-
('Ruth',
|
|
65
|
-
('Robert',
|
|
66
|
-
('Bobert',
|
|
67
|
-
('Jan',
|
|
68
|
-
('Megan',
|
|
53
|
+
VALUES ('Bob', 30),
|
|
54
|
+
('Bert', 10),
|
|
55
|
+
('Jack', 12),
|
|
56
|
+
('Mike', 31),
|
|
57
|
+
('Dave', 44),
|
|
58
|
+
('Jim', 43),
|
|
59
|
+
('Kerry', 32),
|
|
60
|
+
('Julie', 12),
|
|
61
|
+
('Kim', 55),
|
|
62
|
+
('Andy', 33),
|
|
63
|
+
('John', 22),
|
|
64
|
+
('Ruth', 66),
|
|
65
|
+
('Robert', 88),
|
|
66
|
+
('Bobert', 99),
|
|
67
|
+
('Jan', 22),
|
|
68
|
+
('Megan', 11);
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
IF OBJECT_ID ('Chains.sizes', 'U') IS NOT NULL
|
|
@@ -243,11 +243,14 @@ class SqlServerIntegration extends Sql implements DatasourcePlus {
|
|
|
243
243
|
if (typeof name !== "string") {
|
|
244
244
|
continue
|
|
245
245
|
}
|
|
246
|
+
const hasDefault = def.COLUMN_DEFAULT
|
|
247
|
+
const isAuto = !!autoColumns.find(col => col === name)
|
|
248
|
+
const required = !!requiredColumns.find(col => col === name)
|
|
246
249
|
schema[name] = {
|
|
247
|
-
autocolumn:
|
|
250
|
+
autocolumn: isAuto,
|
|
248
251
|
name: name,
|
|
249
252
|
constraints: {
|
|
250
|
-
presence:
|
|
253
|
+
presence: required && !isAuto && !hasDefault,
|
|
251
254
|
},
|
|
252
255
|
...convertSqlType(def.DATA_TYPE),
|
|
253
256
|
externalType: def.DATA_TYPE,
|
|
@@ -229,13 +229,15 @@ class MySQLIntegration extends Sql implements DatasourcePlus {
|
|
|
229
229
|
if (column.Key === "PRI" && primaryKeys.indexOf(column.Key) === -1) {
|
|
230
230
|
primaryKeys.push(columnName)
|
|
231
231
|
}
|
|
232
|
-
const
|
|
233
|
-
presence: column.Null !== "YES",
|
|
234
|
-
}
|
|
232
|
+
const hasDefault = column.Default != null
|
|
235
233
|
const isAuto: boolean =
|
|
236
234
|
typeof column.Extra === "string" &&
|
|
237
235
|
(column.Extra === "auto_increment" ||
|
|
238
236
|
column.Extra.toLowerCase().includes("generated"))
|
|
237
|
+
const required = column.Null !== "YES"
|
|
238
|
+
const constraints = {
|
|
239
|
+
presence: required && !isAuto && !hasDefault,
|
|
240
|
+
}
|
|
239
241
|
schema[columnName] = {
|
|
240
242
|
name: columnName,
|
|
241
243
|
autocolumn: isAuto,
|
|
@@ -262,15 +262,17 @@ class PostgresIntegration extends Sql implements DatasourcePlus {
|
|
|
262
262
|
column.identity_start ||
|
|
263
263
|
column.identity_increment
|
|
264
264
|
)
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
const hasDefault =
|
|
265
|
+
const hasDefault = column.column_default != null
|
|
266
|
+
const hasNextVal =
|
|
269
267
|
typeof column.column_default === "string" &&
|
|
270
268
|
column.column_default.startsWith("nextval")
|
|
271
269
|
const isGenerated =
|
|
272
270
|
column.is_generated && column.is_generated !== "NEVER"
|
|
273
|
-
const isAuto: boolean =
|
|
271
|
+
const isAuto: boolean = hasNextVal || identity || isGenerated
|
|
272
|
+
const required = column.is_nullable === "NO"
|
|
273
|
+
const constraints = {
|
|
274
|
+
presence: required && !hasDefault && !isGenerated,
|
|
275
|
+
}
|
|
274
276
|
tables[tableName].schema[columnName] = {
|
|
275
277
|
autocolumn: isAuto,
|
|
276
278
|
name: columnName,
|