@budibase/server 1.2.35 → 1.2.38
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.05962580.js → index.47bfb9a6.js} +48 -48
- package/builder/index.html +1 -1
- package/coverage/clover.xml +2 -2
- package/coverage/coverage-final.json +13 -13
- package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
- package/coverage/lcov-report/api/controllers/automation.js.html +3 -3
- package/coverage/lcov-report/api/controllers/backup.js.html +3 -3
- package/coverage/lcov-report/api/controllers/cloud.js.html +4 -4
- package/coverage/lcov-report/api/controllers/component.js.html +3 -3
- package/coverage/lcov-report/api/controllers/datasource.js.html +3 -3
- package/coverage/lcov-report/api/controllers/dev.js.html +4 -4
- package/coverage/lcov-report/api/controllers/index.html +1 -1
- package/coverage/lcov-report/api/controllers/integration.js.html +3 -3
- package/coverage/lcov-report/api/controllers/layout.js.html +1 -1
- package/coverage/lcov-report/api/controllers/metadata.js.html +1 -1
- package/coverage/lcov-report/api/controllers/migrations.js.html +1 -1
- package/coverage/lcov-report/api/controllers/permission.js.html +1 -1
- package/coverage/lcov-report/api/controllers/query/index.html +1 -1
- package/coverage/lcov-report/api/controllers/query/validation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/role.js.html +1 -1
- package/coverage/lcov-report/api/controllers/routing.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/index.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internal.js.html +3 -3
- package/coverage/lcov-report/api/controllers/row/internalSearch.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/staticFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/utils.js.html +1 -1
- package/coverage/lcov-report/api/controllers/screen.js.html +1 -1
- package/coverage/lcov-report/api/controllers/script.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/bulkFormula.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/external.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.html +1 -1
- package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/templates.js.html +1 -1
- package/coverage/lcov-report/api/controllers/user.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/exporters.js.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.html +1 -1
- package/coverage/lcov-report/api/controllers/view/index.js.html +3 -3
- package/coverage/lcov-report/api/controllers/view/utils.js.html +5 -5
- package/coverage/lcov-report/api/controllers/view/viewBuilder.js.html +1 -1
- package/coverage/lcov-report/api/controllers/webhook.js.html +1 -1
- package/coverage/lcov-report/api/index.html +1 -1
- package/coverage/lcov-report/api/index.js.html +1 -1
- package/coverage/lcov-report/api/routes/analytics.js.html +1 -1
- package/coverage/lcov-report/api/routes/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/routes/auth.js.html +1 -1
- package/coverage/lcov-report/api/routes/automation.js.html +1 -1
- package/coverage/lcov-report/api/routes/backup.js.html +1 -1
- package/coverage/lcov-report/api/routes/cloud.js.html +1 -1
- package/coverage/lcov-report/api/routes/component.js.html +1 -1
- package/coverage/lcov-report/api/routes/datasource.js.html +1 -1
- package/coverage/lcov-report/api/routes/deploy.js.html +1 -1
- package/coverage/lcov-report/api/routes/dev.js.html +1 -1
- package/coverage/lcov-report/api/routes/index.html +1 -1
- package/coverage/lcov-report/api/routes/integration.js.html +1 -1
- package/coverage/lcov-report/api/routes/layout.js.html +1 -1
- package/coverage/lcov-report/api/routes/metadata.js.html +1 -1
- package/coverage/lcov-report/api/routes/migrations.js.html +1 -1
- package/coverage/lcov-report/api/routes/permission.js.html +1 -1
- package/coverage/lcov-report/api/routes/query.js.html +1 -1
- package/coverage/lcov-report/api/routes/role.js.html +1 -1
- package/coverage/lcov-report/api/routes/routing.js.html +1 -1
- package/coverage/lcov-report/api/routes/screen.js.html +1 -1
- package/coverage/lcov-report/api/routes/script.js.html +1 -1
- package/coverage/lcov-report/api/routes/table.js.html +1 -1
- package/coverage/lcov-report/api/routes/templates.js.html +1 -1
- package/coverage/lcov-report/api/routes/user.js.html +1 -1
- package/coverage/lcov-report/api/routes/utils/index.html +1 -1
- package/coverage/lcov-report/api/routes/utils/validators.js.html +1 -1
- package/coverage/lcov-report/api/routes/view.js.html +1 -1
- package/coverage/lcov-report/api/routes/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/actions.js.html +1 -1
- package/coverage/lcov-report/automations/automationUtils.js.html +1 -1
- package/coverage/lcov-report/automations/bullboard.js.html +1 -1
- package/coverage/lcov-report/automations/index.html +1 -1
- package/coverage/lcov-report/automations/index.js.html +1 -1
- package/coverage/lcov-report/automations/steps/bash.js.html +1 -1
- package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
- package/coverage/lcov-report/automations/steps/discord.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeQuery.js.html +1 -1
- package/coverage/lcov-report/automations/steps/executeScript.js.html +1 -1
- package/coverage/lcov-report/automations/steps/filter.js.html +1 -1
- package/coverage/lcov-report/automations/steps/index.html +1 -1
- package/coverage/lcov-report/automations/steps/integromat.js.html +1 -1
- package/coverage/lcov-report/automations/steps/loop.js.html +1 -1
- package/coverage/lcov-report/automations/steps/outgoingWebhook.js.html +1 -1
- package/coverage/lcov-report/automations/steps/queryRows.js.html +1 -1
- package/coverage/lcov-report/automations/steps/sendSmtpEmail.js.html +1 -1
- package/coverage/lcov-report/automations/steps/serverLog.js.html +1 -1
- package/coverage/lcov-report/automations/steps/slack.js.html +1 -1
- package/coverage/lcov-report/automations/steps/updateRow.js.html +1 -1
- package/coverage/lcov-report/automations/steps/utils.js.html +1 -1
- package/coverage/lcov-report/automations/steps/zapier.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/app.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/cron.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/index.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowDeleted.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowSaved.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/rowUpdated.js.html +1 -1
- package/coverage/lcov-report/automations/triggerInfo/webhook.js.html +1 -1
- package/coverage/lcov-report/automations/triggers.js.html +1 -1
- package/coverage/lcov-report/constants/index.html +1 -1
- package/coverage/lcov-report/constants/index.js.html +1 -1
- package/coverage/lcov-report/constants/layouts.js.html +1 -1
- package/coverage/lcov-report/constants/screens.js.html +1 -1
- package/coverage/lcov-report/db/inMemoryView.js.html +1 -1
- package/coverage/lcov-report/db/index.html +1 -1
- package/coverage/lcov-report/db/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/LinkController.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.html +1 -1
- package/coverage/lcov-report/db/linkedRows/index.js.html +1 -1
- package/coverage/lcov-report/db/linkedRows/linkUtils.js.html +3 -3
- package/coverage/lcov-report/db/newid.js.html +1 -1
- package/coverage/lcov-report/db/utils.js.html +39 -39
- package/coverage/lcov-report/events/AutomationEmitter.js.html +1 -1
- package/coverage/lcov-report/events/index.html +1 -1
- package/coverage/lcov-report/events/index.js.html +1 -1
- package/coverage/lcov-report/events/utils.js.html +1 -1
- package/coverage/lcov-report/index.html +1 -1
- package/coverage/lcov-report/integrations/tests/TestConfiguration.js.html +1 -1
- package/coverage/lcov-report/integrations/tests/index.html +1 -1
- package/coverage/lcov-report/middleware/appInfo.js.html +1 -1
- package/coverage/lcov-report/middleware/builder.js.html +3 -3
- package/coverage/lcov-report/middleware/currentapp.js.html +1 -1
- package/coverage/lcov-report/middleware/index.html +1 -1
- package/coverage/lcov-report/middleware/joi-validator.js.html +1 -1
- package/coverage/lcov-report/middleware/publicApi.js.html +1 -1
- package/coverage/lcov-report/middleware/resourceId.js.html +1 -1
- package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
- package/coverage/lcov-report/middleware/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/budibaseDir.js.html +1 -1
- package/coverage/lcov-report/utilities/centralPath.js.html +1 -1
- package/coverage/lcov-report/utilities/csvParser.js.html +1 -1
- package/coverage/lcov-report/utilities/global.js.html +1 -1
- package/coverage/lcov-report/utilities/index.html +1 -1
- package/coverage/lcov-report/utilities/index.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/inMemoryQueue.js.html +1 -1
- package/coverage/lcov-report/utilities/queue/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.html +1 -1
- package/coverage/lcov-report/utilities/routing/index.js.html +3 -3
- package/coverage/lcov-report/utilities/rowProcessor/index.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/index.js.html +1 -1
- package/coverage/lcov-report/utilities/rowProcessor/utils.js.html +1 -1
- package/coverage/lcov-report/utilities/scriptRunner.js.html +1 -1
- package/coverage/lcov-report/utilities/security.js.html +9 -9
- package/coverage/lcov-report/utilities/statusCodes.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/index.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/rows.js.html +1 -1
- package/coverage/lcov-report/utilities/usageQuota/usageQuoteReset.js.html +1 -1
- package/coverage/lcov-report/utilities/users.js.html +1 -1
- package/coverage/lcov-report/utilities/workerRequests.js.html +1 -1
- package/dist/api/controllers/analytics.js +1 -1
- package/dist/api/controllers/application.js +8 -8
- package/dist/api/controllers/automation.js +2 -2
- package/dist/api/controllers/backup.js +2 -2
- package/dist/api/controllers/cloud.js +3 -3
- package/dist/api/controllers/component.js +2 -2
- package/dist/api/controllers/datasource.js +2 -2
- package/dist/api/controllers/deploy/index.js +6 -6
- package/dist/api/controllers/dev.js +3 -3
- package/dist/api/controllers/integration.js +2 -2
- package/dist/api/controllers/public/utils.js +1 -1
- package/dist/api/controllers/row/ExternalRequest.js +3 -3
- package/dist/api/controllers/row/internal.js +2 -2
- package/dist/api/controllers/static/index.js +2 -2
- package/dist/api/controllers/view/index.js +2 -2
- package/dist/api/controllers/view/utils.js +3 -3
- package/dist/db/linkedRows/linkUtils.js +2 -2
- package/dist/db/utils.js +37 -37
- package/dist/db/views/staticViews.js +4 -4
- package/dist/definitions/automations.js +6 -6
- package/dist/definitions/datasource.js +6 -70
- package/dist/integrations/airtable.js +13 -13
- package/dist/integrations/arangodb.js +8 -8
- package/dist/integrations/base/sql.js +28 -28
- package/dist/integrations/base/sqlTable.js +4 -4
- package/dist/integrations/couchdb.js +8 -8
- package/dist/integrations/dynamodb.js +21 -21
- package/dist/integrations/elasticsearch.js +12 -12
- package/dist/integrations/firebase.js +12 -12
- package/dist/integrations/googlesheets.js +14 -14
- package/dist/integrations/index.js +34 -34
- package/dist/integrations/microsoftSqlServer.js +14 -14
- package/dist/integrations/mongodb.js +9 -9
- package/dist/integrations/mysql.js +13 -13
- package/dist/integrations/oracle.js +13 -13
- package/dist/integrations/postgres.js +15 -15
- package/dist/integrations/redis.js +10 -10
- package/dist/integrations/rest.js +15 -14
- package/dist/integrations/s3.js +2 -2
- package/dist/integrations/snowflake.js +5 -5
- package/dist/integrations/utils.js +14 -14
- package/dist/middleware/builder.js +2 -2
- package/dist/migrations/functions/appUrls.js +2 -2
- package/dist/migrations/functions/backfill/app/queries.js +3 -1
- package/dist/migrations/functions/backfill/app.js +1 -1
- package/dist/migrations/functions/backfill/global/users.js +1 -1
- package/dist/package.json +6 -6
- package/dist/tests/utilities/TestConfiguration.js +2 -2
- package/dist/threads/automation.js +2 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/routing/index.js +2 -2
- package/dist/utilities/security.js +8 -8
- package/package.json +7 -7
- package/src/api/controllers/analytics.ts +2 -2
- package/src/api/controllers/application.ts +9 -9
- package/src/api/controllers/automation.js +2 -2
- package/src/api/controllers/backup.js +2 -2
- package/src/api/controllers/cloud.js +3 -3
- package/src/api/controllers/component.js +2 -2
- package/src/api/controllers/datasource.js +2 -2
- package/src/api/controllers/deploy/index.ts +7 -7
- package/src/api/controllers/dev.js +3 -3
- package/src/api/controllers/integration.js +2 -2
- package/src/api/controllers/public/utils.ts +2 -2
- package/src/api/controllers/query/import/sources/openapi2.ts +1 -1
- package/src/api/controllers/query/import/sources/openapi3.ts +1 -1
- package/src/api/controllers/row/ExternalRequest.ts +5 -7
- package/src/api/controllers/row/internal.js +2 -2
- package/src/api/controllers/static/index.ts +2 -2
- package/src/api/controllers/view/index.js +2 -2
- package/src/api/controllers/view/utils.js +4 -4
- package/src/db/linkedRows/linkUtils.js +2 -2
- package/src/db/utils.js +38 -38
- package/src/db/views/staticViews.js +4 -9
- package/src/definitions/automations.ts +2 -2
- package/src/definitions/common.ts +14 -65
- package/src/definitions/datasource.ts +5 -250
- package/src/integrations/airtable.ts +16 -16
- package/src/integrations/arangodb.ts +11 -11
- package/src/integrations/base/sql.ts +16 -16
- package/src/integrations/base/sqlTable.ts +1 -6
- package/src/integrations/base/utils.ts +1 -2
- package/src/integrations/couchdb.ts +11 -11
- package/src/integrations/dynamodb.ts +24 -24
- package/src/integrations/elasticsearch.ts +15 -15
- package/src/integrations/firebase.ts +15 -15
- package/src/integrations/googlesheets.ts +19 -18
- package/src/integrations/index.ts +34 -34
- package/src/integrations/microsoftSqlServer.ts +19 -18
- package/src/integrations/mongodb.ts +12 -12
- package/src/integrations/mysql.ts +19 -18
- package/src/integrations/oracle.ts +16 -16
- package/src/integrations/postgres.ts +20 -20
- package/src/integrations/queries/sql.ts +1 -2
- package/src/integrations/redis.ts +10 -14
- package/src/integrations/rest.ts +22 -20
- package/src/integrations/s3.ts +2 -3
- package/src/integrations/snowflake.ts +5 -5
- package/src/integrations/tests/sql.spec.js +7 -7
- package/src/integrations/utils.ts +8 -9
- package/src/middleware/builder.js +2 -2
- package/src/migrations/functions/appUrls.ts +2 -2
- package/src/migrations/functions/backfill/app/queries.ts +3 -2
- package/src/migrations/functions/backfill/app.ts +1 -1
- package/src/migrations/functions/backfill/global/users.ts +1 -1
- package/src/migrations/functions/tests/appUrls.spec.js +3 -3
- package/src/migrations/tests/index.spec.ts +2 -2
- package/src/tests/utilities/TestConfiguration.js +2 -2
- package/src/threads/automation.ts +3 -3
- package/src/utilities/routing/index.js +2 -2
- package/src/utilities/security.js +8 -8
- package/dist/integrations/base/IntegrationBase.js +0 -2
- package/dist/integrations/base/datasourcePlus.js +0 -2
- package/src/integrations/base/IntegrationBase.ts +0 -6
- package/src/integrations/base/datasourcePlus.ts +0 -13
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Integration,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
DatasourceFieldType,
|
|
4
|
+
QueryType,
|
|
5
|
+
IntegrationBase,
|
|
6
|
+
} from "@budibase/types"
|
|
7
7
|
|
|
8
8
|
module AirtableModule {
|
|
9
9
|
const Airtable = require("airtable")
|
|
@@ -21,61 +21,61 @@ module AirtableModule {
|
|
|
21
21
|
type: "Spreadsheet",
|
|
22
22
|
datasource: {
|
|
23
23
|
apiKey: {
|
|
24
|
-
type:
|
|
24
|
+
type: DatasourceFieldType.PASSWORD,
|
|
25
25
|
default: "enter api key",
|
|
26
26
|
required: true,
|
|
27
27
|
},
|
|
28
28
|
base: {
|
|
29
|
-
type:
|
|
29
|
+
type: DatasourceFieldType.STRING,
|
|
30
30
|
default: "mybase",
|
|
31
31
|
required: true,
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
34
|
query: {
|
|
35
35
|
create: {
|
|
36
|
-
type:
|
|
36
|
+
type: QueryType.FIELDS,
|
|
37
37
|
customisable: true,
|
|
38
38
|
fields: {
|
|
39
39
|
table: {
|
|
40
|
-
type:
|
|
40
|
+
type: DatasourceFieldType.STRING,
|
|
41
41
|
required: true,
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
45
|
read: {
|
|
46
|
-
type:
|
|
46
|
+
type: QueryType.FIELDS,
|
|
47
47
|
fields: {
|
|
48
48
|
table: {
|
|
49
|
-
type:
|
|
49
|
+
type: DatasourceFieldType.STRING,
|
|
50
50
|
required: true,
|
|
51
51
|
},
|
|
52
52
|
view: {
|
|
53
|
-
type:
|
|
53
|
+
type: DatasourceFieldType.STRING,
|
|
54
54
|
required: true,
|
|
55
55
|
},
|
|
56
56
|
numRecords: {
|
|
57
|
-
type:
|
|
57
|
+
type: DatasourceFieldType.NUMBER,
|
|
58
58
|
default: 10,
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
61
|
},
|
|
62
62
|
update: {
|
|
63
|
-
type:
|
|
63
|
+
type: QueryType.FIELDS,
|
|
64
64
|
customisable: true,
|
|
65
65
|
fields: {
|
|
66
66
|
id: {
|
|
67
67
|
display: "Record ID",
|
|
68
|
-
type:
|
|
68
|
+
type: DatasourceFieldType.STRING,
|
|
69
69
|
required: true,
|
|
70
70
|
},
|
|
71
71
|
table: {
|
|
72
|
-
type:
|
|
72
|
+
type: DatasourceFieldType.STRING,
|
|
73
73
|
required: true,
|
|
74
74
|
},
|
|
75
75
|
},
|
|
76
76
|
},
|
|
77
77
|
delete: {
|
|
78
|
-
type:
|
|
78
|
+
type: QueryType.JSON,
|
|
79
79
|
},
|
|
80
80
|
},
|
|
81
81
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Integration,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
DatasourceFieldType,
|
|
4
|
+
QueryType,
|
|
5
|
+
IntegrationBase,
|
|
6
|
+
} from "@budibase/types"
|
|
7
7
|
|
|
8
8
|
module ArangoModule {
|
|
9
9
|
const { Database, aql } = require("arangojs")
|
|
@@ -24,35 +24,35 @@ module ArangoModule {
|
|
|
24
24
|
"ArangoDB is a scalable open-source multi-model database natively supporting graph, document and search. All supported data models & access patterns can be combined in queries allowing for maximal flexibility. ",
|
|
25
25
|
datasource: {
|
|
26
26
|
url: {
|
|
27
|
-
type:
|
|
27
|
+
type: DatasourceFieldType.STRING,
|
|
28
28
|
default: "http://localhost:8529",
|
|
29
29
|
required: true,
|
|
30
30
|
},
|
|
31
31
|
username: {
|
|
32
|
-
type:
|
|
32
|
+
type: DatasourceFieldType.STRING,
|
|
33
33
|
default: "root",
|
|
34
34
|
required: true,
|
|
35
35
|
},
|
|
36
36
|
password: {
|
|
37
|
-
type:
|
|
37
|
+
type: DatasourceFieldType.PASSWORD,
|
|
38
38
|
required: true,
|
|
39
39
|
},
|
|
40
40
|
databaseName: {
|
|
41
|
-
type:
|
|
41
|
+
type: DatasourceFieldType.STRING,
|
|
42
42
|
default: "_system",
|
|
43
43
|
required: true,
|
|
44
44
|
},
|
|
45
45
|
collection: {
|
|
46
|
-
type:
|
|
46
|
+
type: DatasourceFieldType.STRING,
|
|
47
47
|
required: true,
|
|
48
48
|
},
|
|
49
49
|
},
|
|
50
50
|
query: {
|
|
51
51
|
read: {
|
|
52
|
-
type:
|
|
52
|
+
type: QueryType.SQL,
|
|
53
53
|
},
|
|
54
54
|
create: {
|
|
55
|
-
type:
|
|
55
|
+
type: QueryType.JSON,
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
}
|
|
@@ -2,12 +2,12 @@ import { Knex, knex } from "knex"
|
|
|
2
2
|
import {
|
|
3
3
|
Operation,
|
|
4
4
|
QueryJson,
|
|
5
|
-
QueryOptions,
|
|
6
5
|
RelationshipsJson,
|
|
7
6
|
SearchFilters,
|
|
8
7
|
SortDirection,
|
|
9
|
-
} from "
|
|
10
|
-
import {
|
|
8
|
+
} from "@budibase/types"
|
|
9
|
+
import { QueryOptions } from "../../definitions/datasource"
|
|
10
|
+
import { isIsoDateString, SqlClient } from "../utils"
|
|
11
11
|
import SqlTableQueryBuilder from "./sqlTable"
|
|
12
12
|
import environment from "../../environment"
|
|
13
13
|
|
|
@@ -27,14 +27,14 @@ function likeKey(client: string, key: string): string {
|
|
|
27
27
|
}
|
|
28
28
|
let start: string, end: string
|
|
29
29
|
switch (client) {
|
|
30
|
-
case
|
|
30
|
+
case SqlClient.MY_SQL:
|
|
31
31
|
start = end = "`"
|
|
32
32
|
break
|
|
33
|
-
case
|
|
34
|
-
case
|
|
33
|
+
case SqlClient.ORACLE:
|
|
34
|
+
case SqlClient.POSTGRES:
|
|
35
35
|
start = end = '"'
|
|
36
36
|
break
|
|
37
|
-
case
|
|
37
|
+
case SqlClient.MS_SQL:
|
|
38
38
|
start = "["
|
|
39
39
|
end = "]"
|
|
40
40
|
break
|
|
@@ -102,7 +102,7 @@ function generateSelectStatement(
|
|
|
102
102
|
if (
|
|
103
103
|
columnName &&
|
|
104
104
|
schema?.[columnName] &&
|
|
105
|
-
knex.client.config.client ===
|
|
105
|
+
knex.client.config.client === SqlClient.POSTGRES
|
|
106
106
|
) {
|
|
107
107
|
const externalType = schema[columnName].externalType
|
|
108
108
|
if (externalType?.includes("money")) {
|
|
@@ -146,7 +146,7 @@ class InternalBuilder {
|
|
|
146
146
|
const like = (key: string, value: any) => {
|
|
147
147
|
const fnc = allOr ? "orWhere" : "where"
|
|
148
148
|
// postgres supports ilike, nothing else does
|
|
149
|
-
if (this.client ===
|
|
149
|
+
if (this.client === SqlClient.POSTGRES) {
|
|
150
150
|
query = query[fnc](key, "ilike", `%${value}%`)
|
|
151
151
|
} else {
|
|
152
152
|
const rawFnc = `${fnc}Raw`
|
|
@@ -173,7 +173,7 @@ class InternalBuilder {
|
|
|
173
173
|
iterate(filters.string, (key, value) => {
|
|
174
174
|
const fnc = allOr ? "orWhere" : "where"
|
|
175
175
|
// postgres supports ilike, nothing else does
|
|
176
|
-
if (this.client ===
|
|
176
|
+
if (this.client === SqlClient.POSTGRES) {
|
|
177
177
|
query = query[fnc](key, "ilike", `${value}%`)
|
|
178
178
|
} else {
|
|
179
179
|
const rawFnc = `${fnc}Raw`
|
|
@@ -229,7 +229,7 @@ class InternalBuilder {
|
|
|
229
229
|
if (filters.contains) {
|
|
230
230
|
const fnc = allOr ? "orWhere" : "where"
|
|
231
231
|
const rawFnc = `${fnc}Raw`
|
|
232
|
-
if (this.client ===
|
|
232
|
+
if (this.client === SqlClient.POSTGRES) {
|
|
233
233
|
iterate(filters.contains, (key: string, value: any) => {
|
|
234
234
|
const fieldNames = key.split(/\./g)
|
|
235
235
|
const tableName = fieldNames[0]
|
|
@@ -242,7 +242,7 @@ class InternalBuilder {
|
|
|
242
242
|
`"${tableName}"."${columnName}"::jsonb @> '[${value}]'`
|
|
243
243
|
)
|
|
244
244
|
})
|
|
245
|
-
} else if (this.client ===
|
|
245
|
+
} else if (this.client === SqlClient.MY_SQL) {
|
|
246
246
|
iterate(filters.contains, (key: string, value: any) => {
|
|
247
247
|
if (typeof value === "string") {
|
|
248
248
|
value = `"${value}"`
|
|
@@ -265,7 +265,7 @@ class InternalBuilder {
|
|
|
265
265
|
const direction = value === SortDirection.ASCENDING ? "asc" : "desc"
|
|
266
266
|
query = query.orderBy(`${table?.name}.${key}`, direction)
|
|
267
267
|
}
|
|
268
|
-
} else if (this.client ===
|
|
268
|
+
} else if (this.client === SqlClient.MS_SQL && paginate?.limit) {
|
|
269
269
|
// @ts-ignore
|
|
270
270
|
query = query.orderBy(`${table?.name}.${table?.primary[0]}`)
|
|
271
271
|
}
|
|
@@ -414,7 +414,7 @@ class InternalBuilder {
|
|
|
414
414
|
[tableName]: query,
|
|
415
415
|
}).select(selectStatement)
|
|
416
416
|
// have to add after as well (this breaks MS-SQL)
|
|
417
|
-
if (this.client !==
|
|
417
|
+
if (this.client !== SqlClient.MS_SQL) {
|
|
418
418
|
preQuery = this.addSorting(preQuery, json)
|
|
419
419
|
}
|
|
420
420
|
// handle joins
|
|
@@ -565,9 +565,9 @@ class SqlQueryBuilder extends SqlTableQueryBuilder {
|
|
|
565
565
|
// same as delete, manage returning
|
|
566
566
|
if (operation === Operation.CREATE || operation === Operation.UPDATE) {
|
|
567
567
|
let id
|
|
568
|
-
if (sqlClient ===
|
|
568
|
+
if (sqlClient === SqlClient.MS_SQL) {
|
|
569
569
|
id = results?.[0].id
|
|
570
|
-
} else if (sqlClient ===
|
|
570
|
+
} else if (sqlClient === SqlClient.MY_SQL) {
|
|
571
571
|
id = results?.insertId
|
|
572
572
|
}
|
|
573
573
|
row = processFn(
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { Knex, knex } from "knex"
|
|
2
|
-
import { Table } from "
|
|
3
|
-
import {
|
|
4
|
-
Operation,
|
|
5
|
-
QueryJson,
|
|
6
|
-
RenameColumn,
|
|
7
|
-
} from "../../definitions/datasource"
|
|
2
|
+
import { Operation, QueryJson, RenameColumn, Table } from "@budibase/types"
|
|
8
3
|
import { breakExternalTableId } from "../utils"
|
|
9
4
|
import SchemaBuilder = Knex.SchemaBuilder
|
|
10
5
|
import CreateTableBuilder = Knex.CreateTableBuilder
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Integration,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
DatasourceFieldType,
|
|
4
|
+
QueryType,
|
|
5
|
+
IntegrationBase,
|
|
6
|
+
} from "@budibase/types"
|
|
7
7
|
|
|
8
8
|
module CouchDBModule {
|
|
9
9
|
const PouchDB = require("pouchdb")
|
|
@@ -21,30 +21,30 @@ module CouchDBModule {
|
|
|
21
21
|
"Apache CouchDB is an open-source document-oriented NoSQL database, implemented in Erlang.",
|
|
22
22
|
datasource: {
|
|
23
23
|
url: {
|
|
24
|
-
type:
|
|
24
|
+
type: DatasourceFieldType.STRING,
|
|
25
25
|
required: true,
|
|
26
26
|
default: "http://localhost:5984",
|
|
27
27
|
},
|
|
28
28
|
database: {
|
|
29
|
-
type:
|
|
29
|
+
type: DatasourceFieldType.STRING,
|
|
30
30
|
required: true,
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
query: {
|
|
34
34
|
create: {
|
|
35
|
-
type:
|
|
35
|
+
type: QueryType.JSON,
|
|
36
36
|
},
|
|
37
37
|
read: {
|
|
38
|
-
type:
|
|
38
|
+
type: QueryType.JSON,
|
|
39
39
|
},
|
|
40
40
|
update: {
|
|
41
|
-
type:
|
|
41
|
+
type: QueryType.JSON,
|
|
42
42
|
},
|
|
43
43
|
delete: {
|
|
44
|
-
type:
|
|
44
|
+
type: QueryType.FIELDS,
|
|
45
45
|
fields: {
|
|
46
46
|
id: {
|
|
47
|
-
type:
|
|
47
|
+
type: DatasourceFieldType.STRING,
|
|
48
48
|
required: true,
|
|
49
49
|
},
|
|
50
50
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Integration,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
DatasourceFieldType,
|
|
4
|
+
QueryType,
|
|
5
|
+
IntegrationBase,
|
|
6
|
+
} from "@budibase/types"
|
|
7
7
|
|
|
8
8
|
module DynamoModule {
|
|
9
9
|
const AWS = require("aws-sdk")
|
|
@@ -24,101 +24,101 @@ module DynamoModule {
|
|
|
24
24
|
type: "Non-relational",
|
|
25
25
|
datasource: {
|
|
26
26
|
region: {
|
|
27
|
-
type:
|
|
27
|
+
type: DatasourceFieldType.STRING,
|
|
28
28
|
required: true,
|
|
29
29
|
default: "us-east-1",
|
|
30
30
|
},
|
|
31
31
|
accessKeyId: {
|
|
32
|
-
type:
|
|
32
|
+
type: DatasourceFieldType.PASSWORD,
|
|
33
33
|
required: true,
|
|
34
34
|
},
|
|
35
35
|
secretAccessKey: {
|
|
36
|
-
type:
|
|
36
|
+
type: DatasourceFieldType.PASSWORD,
|
|
37
37
|
required: true,
|
|
38
38
|
},
|
|
39
39
|
endpoint: {
|
|
40
|
-
type:
|
|
40
|
+
type: DatasourceFieldType.STRING,
|
|
41
41
|
required: false,
|
|
42
42
|
default: "https://dynamodb.us-east-1.amazonaws.com",
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
45
|
query: {
|
|
46
46
|
create: {
|
|
47
|
-
type:
|
|
47
|
+
type: QueryType.FIELDS,
|
|
48
48
|
customisable: true,
|
|
49
49
|
fields: {
|
|
50
50
|
table: {
|
|
51
|
-
type:
|
|
51
|
+
type: DatasourceFieldType.STRING,
|
|
52
52
|
required: true,
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
55
|
},
|
|
56
56
|
read: {
|
|
57
|
-
type:
|
|
57
|
+
type: QueryType.FIELDS,
|
|
58
58
|
customisable: true,
|
|
59
59
|
readable: true,
|
|
60
60
|
fields: {
|
|
61
61
|
table: {
|
|
62
|
-
type:
|
|
62
|
+
type: DatasourceFieldType.STRING,
|
|
63
63
|
required: true,
|
|
64
64
|
},
|
|
65
65
|
index: {
|
|
66
|
-
type:
|
|
66
|
+
type: DatasourceFieldType.STRING,
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
69
|
},
|
|
70
70
|
scan: {
|
|
71
|
-
type:
|
|
71
|
+
type: QueryType.FIELDS,
|
|
72
72
|
customisable: true,
|
|
73
73
|
readable: true,
|
|
74
74
|
fields: {
|
|
75
75
|
table: {
|
|
76
|
-
type:
|
|
76
|
+
type: DatasourceFieldType.STRING,
|
|
77
77
|
required: true,
|
|
78
78
|
},
|
|
79
79
|
index: {
|
|
80
|
-
type:
|
|
80
|
+
type: DatasourceFieldType.STRING,
|
|
81
81
|
},
|
|
82
82
|
},
|
|
83
83
|
},
|
|
84
84
|
describe: {
|
|
85
|
-
type:
|
|
85
|
+
type: QueryType.FIELDS,
|
|
86
86
|
customisable: true,
|
|
87
87
|
readable: true,
|
|
88
88
|
fields: {
|
|
89
89
|
table: {
|
|
90
|
-
type:
|
|
90
|
+
type: DatasourceFieldType.STRING,
|
|
91
91
|
required: true,
|
|
92
92
|
},
|
|
93
93
|
},
|
|
94
94
|
},
|
|
95
95
|
get: {
|
|
96
|
-
type:
|
|
96
|
+
type: QueryType.FIELDS,
|
|
97
97
|
customisable: true,
|
|
98
98
|
readable: true,
|
|
99
99
|
fields: {
|
|
100
100
|
table: {
|
|
101
|
-
type:
|
|
101
|
+
type: DatasourceFieldType.STRING,
|
|
102
102
|
required: true,
|
|
103
103
|
},
|
|
104
104
|
},
|
|
105
105
|
},
|
|
106
106
|
update: {
|
|
107
|
-
type:
|
|
107
|
+
type: QueryType.FIELDS,
|
|
108
108
|
customisable: true,
|
|
109
109
|
fields: {
|
|
110
110
|
table: {
|
|
111
|
-
type:
|
|
111
|
+
type: DatasourceFieldType.STRING,
|
|
112
112
|
required: true,
|
|
113
113
|
},
|
|
114
114
|
},
|
|
115
115
|
},
|
|
116
116
|
delete: {
|
|
117
|
-
type:
|
|
117
|
+
type: QueryType.FIELDS,
|
|
118
118
|
customisable: true,
|
|
119
119
|
fields: {
|
|
120
120
|
table: {
|
|
121
|
-
type:
|
|
121
|
+
type: DatasourceFieldType.STRING,
|
|
122
122
|
required: true,
|
|
123
123
|
},
|
|
124
124
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Integration,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
DatasourceFieldType,
|
|
4
|
+
QueryType,
|
|
5
|
+
IntegrationBase,
|
|
6
|
+
} from "@budibase/types"
|
|
7
7
|
|
|
8
8
|
module ElasticsearchModule {
|
|
9
9
|
const { Client } = require("@elastic/elasticsearch")
|
|
@@ -20,55 +20,55 @@ module ElasticsearchModule {
|
|
|
20
20
|
type: "Non-relational",
|
|
21
21
|
datasource: {
|
|
22
22
|
url: {
|
|
23
|
-
type:
|
|
23
|
+
type: DatasourceFieldType.STRING,
|
|
24
24
|
required: true,
|
|
25
25
|
default: "http://localhost:9200",
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
query: {
|
|
29
29
|
create: {
|
|
30
|
-
type:
|
|
30
|
+
type: QueryType.FIELDS,
|
|
31
31
|
customisable: true,
|
|
32
32
|
fields: {
|
|
33
33
|
index: {
|
|
34
|
-
type:
|
|
34
|
+
type: DatasourceFieldType.STRING,
|
|
35
35
|
required: true,
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
read: {
|
|
40
|
-
type:
|
|
40
|
+
type: QueryType.FIELDS,
|
|
41
41
|
customisable: true,
|
|
42
42
|
fields: {
|
|
43
43
|
index: {
|
|
44
|
-
type:
|
|
44
|
+
type: DatasourceFieldType.STRING,
|
|
45
45
|
required: true,
|
|
46
46
|
},
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
update: {
|
|
50
|
-
type:
|
|
50
|
+
type: QueryType.FIELDS,
|
|
51
51
|
customisable: true,
|
|
52
52
|
fields: {
|
|
53
53
|
id: {
|
|
54
|
-
type:
|
|
54
|
+
type: DatasourceFieldType.STRING,
|
|
55
55
|
required: true,
|
|
56
56
|
},
|
|
57
57
|
index: {
|
|
58
|
-
type:
|
|
58
|
+
type: DatasourceFieldType.STRING,
|
|
59
59
|
required: true,
|
|
60
60
|
},
|
|
61
61
|
},
|
|
62
62
|
},
|
|
63
63
|
delete: {
|
|
64
|
-
type:
|
|
64
|
+
type: QueryType.FIELDS,
|
|
65
65
|
fields: {
|
|
66
66
|
index: {
|
|
67
|
-
type:
|
|
67
|
+
type: DatasourceFieldType.STRING,
|
|
68
68
|
required: true,
|
|
69
69
|
},
|
|
70
70
|
id: {
|
|
71
|
-
type:
|
|
71
|
+
type: DatasourceFieldType.STRING,
|
|
72
72
|
required: true,
|
|
73
73
|
},
|
|
74
74
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
DatasourceFieldType,
|
|
3
3
|
Integration,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
QueryType,
|
|
5
|
+
IntegrationBase,
|
|
6
|
+
} from "@budibase/types"
|
|
7
7
|
import { Firestore, WhereFilterOp } from "@google-cloud/firestore"
|
|
8
8
|
|
|
9
9
|
module Firebase {
|
|
@@ -21,46 +21,46 @@ module Firebase {
|
|
|
21
21
|
"Cloud Firestore is a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud.",
|
|
22
22
|
datasource: {
|
|
23
23
|
email: {
|
|
24
|
-
type:
|
|
24
|
+
type: DatasourceFieldType.STRING,
|
|
25
25
|
required: true,
|
|
26
26
|
},
|
|
27
27
|
privateKey: {
|
|
28
|
-
type:
|
|
28
|
+
type: DatasourceFieldType.STRING,
|
|
29
29
|
required: true,
|
|
30
30
|
},
|
|
31
31
|
projectId: {
|
|
32
|
-
type:
|
|
32
|
+
type: DatasourceFieldType.STRING,
|
|
33
33
|
required: true,
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
query: {
|
|
37
37
|
create: {
|
|
38
|
-
type:
|
|
38
|
+
type: QueryType.JSON,
|
|
39
39
|
},
|
|
40
40
|
read: {
|
|
41
|
-
type:
|
|
41
|
+
type: QueryType.JSON,
|
|
42
42
|
},
|
|
43
43
|
update: {
|
|
44
|
-
type:
|
|
44
|
+
type: QueryType.JSON,
|
|
45
45
|
},
|
|
46
46
|
delete: {
|
|
47
|
-
type:
|
|
47
|
+
type: QueryType.JSON,
|
|
48
48
|
},
|
|
49
49
|
},
|
|
50
50
|
extra: {
|
|
51
51
|
collection: {
|
|
52
52
|
displayName: "Collection",
|
|
53
|
-
type:
|
|
53
|
+
type: DatasourceFieldType.STRING,
|
|
54
54
|
required: true,
|
|
55
55
|
},
|
|
56
56
|
filterField: {
|
|
57
57
|
displayName: "Filter field",
|
|
58
|
-
type:
|
|
58
|
+
type: DatasourceFieldType.STRING,
|
|
59
59
|
required: false,
|
|
60
60
|
},
|
|
61
61
|
filter: {
|
|
62
62
|
displayName: "Filter comparison",
|
|
63
|
-
type:
|
|
63
|
+
type: DatasourceFieldType.LIST,
|
|
64
64
|
required: false,
|
|
65
65
|
data: {
|
|
66
66
|
read: [
|
|
@@ -79,7 +79,7 @@ module Firebase {
|
|
|
79
79
|
},
|
|
80
80
|
filterValue: {
|
|
81
81
|
displayName: "Filter value",
|
|
82
|
-
type:
|
|
82
|
+
type: DatasourceFieldType.STRING,
|
|
83
83
|
required: false,
|
|
84
84
|
},
|
|
85
85
|
},
|