@budibase/server 0.9.185-alpha.13 → 0.9.185-alpha.17
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/Dockerfile +7 -1
- package/__mocks__/oracledb.ts +31 -0
- package/builder/assets/{index.4a7c5636.css → index.67ac3a72.css} +1 -1
- package/builder/assets/{index.dc495306.js → index.a8407653.js} +176 -175
- package/builder/assets/oracle.66592424.png +0 -0
- package/builder/index.html +2 -2
- package/coverage/clover.xml +239 -230
- package/coverage/coverage-final.json +7 -7
- package/coverage/lcov-report/api/controllers/analytics.js.html +1 -1
- package/coverage/lcov-report/api/controllers/apikeys.js.html +1 -1
- package/coverage/lcov-report/api/controllers/application.js.html +1 -1
- package/coverage/lcov-report/api/controllers/auth.js.html +1 -1
- package/coverage/lcov-report/api/controllers/automation.js.html +1 -1
- package/coverage/lcov-report/api/controllers/backup.js.html +1 -1
- package/coverage/lcov-report/api/controllers/cloud.js.html +1 -1
- package/coverage/lcov-report/api/controllers/component.js.html +1 -1
- package/coverage/lcov-report/api/controllers/datasource.js.html +1 -1
- package/coverage/lcov-report/api/controllers/dev.js.html +1 -1
- package/coverage/lcov-report/api/controllers/hosting.js.html +1 -1
- package/coverage/lcov-report/api/controllers/index.html +1 -1
- package/coverage/lcov-report/api/controllers/integration.js.html +1 -1
- 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/permission.js.html +1 -1
- package/coverage/lcov-report/api/controllers/query.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/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internal.js.html +1 -1
- package/coverage/lcov-report/api/controllers/row/internalSearch.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/external.js.html +29 -8
- package/coverage/lcov-report/api/controllers/table/index.html +13 -13
- package/coverage/lcov-report/api/controllers/table/index.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/internal.js.html +1 -1
- package/coverage/lcov-report/api/controllers/table/utils.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 +1 -1
- package/coverage/lcov-report/api/controllers/view/utils.js.html +1 -1
- 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/application.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/hosting.js.html +1 -1
- package/coverage/lcov-report/api/routes/index.html +1 -1
- package/coverage/lcov-report/api/routes/index.js.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/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/row.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/static.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/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/createRow.js.html +1 -1
- package/coverage/lcov-report/automations/steps/delay.js.html +1 -1
- package/coverage/lcov-report/automations/steps/deleteRow.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/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/automations/utils.js.html +1 -1
- package/coverage/lcov-report/constants/index.html +1 -1
- package/coverage/lcov-report/constants/index.js.html +22 -22
- 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/client.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 +1 -1
- package/coverage/lcov-report/db/newid.js.html +3 -3
- package/coverage/lcov-report/db/utils.js.html +57 -57
- 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 +23 -23
- 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/authorized.js.html +1 -1
- package/coverage/lcov-report/middleware/builder.js.html +1 -1
- 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/resourceId.js.html +1 -1
- package/coverage/lcov-report/middleware/selfhost.js.html +1 -1
- package/coverage/lcov-report/middleware/usageQuota.js.html +1 -1
- package/coverage/lcov-report/middleware/utils.js.html +1 -1
- package/coverage/lcov-report/threads/automation.js.html +14 -8
- package/coverage/lcov-report/threads/index.html +27 -27
- package/coverage/lcov-report/threads/index.js.html +29 -11
- package/coverage/lcov-report/threads/query.js.html +16 -7
- package/coverage/lcov-report/utilities/bcrypt.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 +1 -1
- 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 +1 -1
- package/coverage/lcov-report/utilities/statusCodes.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/coverage/lcov.info +328 -309
- package/dist/api/controllers/table/external.js +8 -1
- package/dist/definitions/datasource.js +1 -0
- package/dist/environment.js +13 -0
- package/dist/integrations/base/sql.js +4 -0
- package/dist/integrations/index.js +6 -0
- package/dist/integrations/oracle.js +345 -0
- package/dist/integrations/utils.js +10 -1
- package/dist/package.json +8 -4
- package/dist/threads/automation.js +3 -1
- package/dist/threads/index.js +9 -3
- package/dist/threads/query.js +3 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -5
- package/scripts/dev/manage.js +1 -0
- package/scripts/integrations/oracle/docker-compose.yml +19 -0
- package/scripts/integrations/oracle/instantclient/linux/x86-64/basiclite-21.4.zip +0 -0
- package/scripts/integrations/oracle/instantclient/linux/x86-64/install.sh +23 -0
- package/scripts/integrations/oracle/oracle.md +90 -0
- package/scripts/integrations/postgres/docker-compose.yml +3 -3
- package/src/api/controllers/table/external.js +8 -1
- package/src/definitions/datasource.ts +1 -0
- package/src/environment.js +15 -0
- package/src/integrations/base/IntegrationBase.ts +4 -4
- package/src/integrations/base/sql.ts +3 -0
- package/src/integrations/index.ts +7 -0
- package/src/integrations/oracle.ts +445 -0
- package/src/integrations/tests/oracle.spec.js +94 -0
- package/src/integrations/utils.ts +10 -1
- package/src/threads/automation.js +3 -1
- package/src/threads/index.js +9 -3
- package/src/threads/query.js +3 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "0.9.185-alpha.
|
|
4
|
+
"version": "0.9.185-alpha.17",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"repository": {
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"author": "Budibase",
|
|
69
69
|
"license": "AGPL-3.0-or-later",
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@budibase/auth": "^0.9.185-alpha.
|
|
72
|
-
"@budibase/client": "^0.9.185-alpha.
|
|
73
|
-
"@budibase/string-templates": "^0.9.185-alpha.
|
|
71
|
+
"@budibase/auth": "^0.9.185-alpha.17",
|
|
72
|
+
"@budibase/client": "^0.9.185-alpha.17",
|
|
73
|
+
"@budibase/string-templates": "^0.9.185-alpha.17",
|
|
74
74
|
"@bull-board/api": "^3.7.0",
|
|
75
75
|
"@bull-board/koa": "^3.7.0",
|
|
76
76
|
"@elastic/elasticsearch": "7.10.0",
|
|
@@ -135,6 +135,7 @@
|
|
|
135
135
|
"@types/koa": "^2.13.3",
|
|
136
136
|
"@types/koa-router": "^7.4.2",
|
|
137
137
|
"@types/node": "^15.12.4",
|
|
138
|
+
"@types/oracledb": "^5.2.1",
|
|
138
139
|
"@typescript-eslint/parser": "4.28.0",
|
|
139
140
|
"babel-jest": "^27.0.2",
|
|
140
141
|
"copyfiles": "^2.4.1",
|
|
@@ -150,5 +151,8 @@
|
|
|
150
151
|
"typescript": "^4.3.5",
|
|
151
152
|
"update-dotenv": "^1.1.1"
|
|
152
153
|
},
|
|
153
|
-
"
|
|
154
|
+
"optionalDependencies": {
|
|
155
|
+
"oracledb": "^5.3.0"
|
|
156
|
+
},
|
|
157
|
+
"gitHead": "145c1c50315cd5942aba687de955afec88ea3dd9"
|
|
154
158
|
}
|
package/scripts/dev/manage.js
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# For more information see:
|
|
2
|
+
# https://container-registry.oracle.com/
|
|
3
|
+
# - Database > Express
|
|
4
|
+
version: "3.8"
|
|
5
|
+
services:
|
|
6
|
+
db:
|
|
7
|
+
container_name: oracle-xe
|
|
8
|
+
platform: linux/x86_64
|
|
9
|
+
image: container-registry.oracle.com/database/express:18.4.0-xe
|
|
10
|
+
environment:
|
|
11
|
+
ORACLE_PWD: oracle
|
|
12
|
+
ports:
|
|
13
|
+
- 1521:1521
|
|
14
|
+
- 5500:5500
|
|
15
|
+
volumes:
|
|
16
|
+
- oracle_data:/opt/oracle/oradata
|
|
17
|
+
|
|
18
|
+
volumes:
|
|
19
|
+
oracle_data:
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Must be root to continue
|
|
4
|
+
if [[ $(id -u) -ne 0 ]] ; then echo "Please run as root" ; exit 1 ; fi
|
|
5
|
+
|
|
6
|
+
# Allow for re-runs
|
|
7
|
+
rm -rf /opt/oracle
|
|
8
|
+
|
|
9
|
+
echo "Installing oracle instant client"
|
|
10
|
+
|
|
11
|
+
# copy and unzip package
|
|
12
|
+
mkdir -p /opt/oracle
|
|
13
|
+
cp scripts/integrations/oracle/instantclient/linux/x86-64/basiclite-21.4.zip /opt/oracle
|
|
14
|
+
cd /opt/oracle
|
|
15
|
+
unzip -qq basiclite-21.4.zip -d .
|
|
16
|
+
rm *.zip
|
|
17
|
+
mv instantclient* instantclient
|
|
18
|
+
|
|
19
|
+
# update runtime link path
|
|
20
|
+
sh -c "echo /opt/oracle/instantclient > /etc/ld.so.conf.d/oracle-instantclient.conf"
|
|
21
|
+
ldconfig /etc/ld.so.conf.d
|
|
22
|
+
|
|
23
|
+
echo "Installation complete"
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
## Database
|
|
4
|
+
|
|
5
|
+
**Important**
|
|
6
|
+
- Oracle database is supported only on **x86-64 architecture**
|
|
7
|
+
- Oracle database is **not supported on Mac ARM architecture** (either via docker or linux virtualization)
|
|
8
|
+
|
|
9
|
+
To install oracle express edition simply run `docker-compose up`
|
|
10
|
+
|
|
11
|
+
- A single instance pluggable database (PDB) will be created named `xepdb`
|
|
12
|
+
- The default password is configured in the compose file as `oracle`
|
|
13
|
+
- The `system`, `sys` and `pdbadmin` users all share this password
|
|
14
|
+
|
|
15
|
+
## Instant Client
|
|
16
|
+
|
|
17
|
+
Before oracle can be connected to from nodejs, the oracle client must be installed.
|
|
18
|
+
For more information see https://www.oracle.com/database/technologies/instant-client/downloads.html
|
|
19
|
+
|
|
20
|
+
**Important**
|
|
21
|
+
- Oracle client is supported only on **x86-64 architecture**
|
|
22
|
+
- Oracle client is **not supported on Mac ARM architecture**
|
|
23
|
+
|
|
24
|
+
### Linux
|
|
25
|
+
Run the provided install script for linux from the `server` root path:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
sudo /bin/bash -e scripts/integrations/oracle/instantclient/linux/x86-64/install.sh
|
|
29
|
+
```
|
|
30
|
+
For more information see: https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html#ic_x64_inst
|
|
31
|
+
|
|
32
|
+
### Mac
|
|
33
|
+
**This has not yet been tested**
|
|
34
|
+
|
|
35
|
+
See: https://www.oracle.com/database/technologies/instant-client/macos-intel-x86-downloads.html#ic_osx_inst
|
|
36
|
+
|
|
37
|
+
# Management
|
|
38
|
+
To connect to oracle sql command line:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
docker exec -it oracle-xe sqlplus -l system/oracle@localhost/xepdb1
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
To create a new schema (where a user is the same as a schema in oracle) named `sales`:
|
|
45
|
+
|
|
46
|
+
```sql
|
|
47
|
+
define USERNAME = sales
|
|
48
|
+
|
|
49
|
+
create user &USERNAME;
|
|
50
|
+
|
|
51
|
+
alter user &USERNAME
|
|
52
|
+
default tablespace users
|
|
53
|
+
temporary tablespace temp
|
|
54
|
+
quota unlimited on users;
|
|
55
|
+
|
|
56
|
+
grant create session,
|
|
57
|
+
create view,
|
|
58
|
+
create sequence,
|
|
59
|
+
create procedure,
|
|
60
|
+
create table,
|
|
61
|
+
create trigger,
|
|
62
|
+
create type,
|
|
63
|
+
create materialized view
|
|
64
|
+
to &USERNAME;
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
To set the password for the sales schema use:
|
|
68
|
+
|
|
69
|
+
```sql
|
|
70
|
+
define USERNAME = sales
|
|
71
|
+
define PASSWORD = sales
|
|
72
|
+
|
|
73
|
+
alter user &USERNAME identified by &PASSWORD;
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
As before the database schema can now be connected to using:
|
|
77
|
+
```bash
|
|
78
|
+
docker exec -it oracle-xe sqlplus -l sales/sales@localhost:1521/xepdb1
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## HR Schema
|
|
82
|
+
|
|
83
|
+
The `HR` schema is populated with dummy data by default in oracle for testing purposes.
|
|
84
|
+
To connect to the HR schema first update the user password and unlock the account by performing
|
|
85
|
+
```sql
|
|
86
|
+
ALTER USER hr ACCOUNT UNLOCK;
|
|
87
|
+
ALTER USER hr IDENTIFIED BY hr
|
|
88
|
+
```
|
|
89
|
+
You should now be able to connect to the hr schema using the credentials hr/hr
|
|
90
|
+
|
|
@@ -11,7 +11,7 @@ services:
|
|
|
11
11
|
ports:
|
|
12
12
|
- "5432:5432"
|
|
13
13
|
volumes:
|
|
14
|
-
|
|
14
|
+
- pg_data:/var/lib/postgresql/data/
|
|
15
15
|
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
16
16
|
|
|
17
17
|
pgadmin:
|
|
@@ -24,5 +24,5 @@ services:
|
|
|
24
24
|
ports:
|
|
25
25
|
- "5050:80"
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
volumes:
|
|
28
|
+
pg_data:
|
|
@@ -161,9 +161,13 @@ function isRelationshipSetup(column) {
|
|
|
161
161
|
exports.save = async function (ctx) {
|
|
162
162
|
const appId = ctx.appId
|
|
163
163
|
const table = ctx.request.body
|
|
164
|
-
// can't do this
|
|
164
|
+
// can't do this right now
|
|
165
165
|
delete table.dataImport
|
|
166
166
|
const datasourceId = getDatasourceId(ctx.request.body)
|
|
167
|
+
// table doesn't exist already, note that it is created
|
|
168
|
+
if (!table._id) {
|
|
169
|
+
table.created = true
|
|
170
|
+
}
|
|
167
171
|
let tableToSave = {
|
|
168
172
|
type: "table",
|
|
169
173
|
_id: buildExternalTableId(datasourceId, table.name),
|
|
@@ -265,6 +269,9 @@ exports.save = async function (ctx) {
|
|
|
265
269
|
exports.destroy = async function (ctx) {
|
|
266
270
|
const appId = ctx.appId
|
|
267
271
|
const tableToDelete = await getTable(appId, ctx.params.tableId)
|
|
272
|
+
if (!tableToDelete || !tableToDelete.created) {
|
|
273
|
+
ctx.throw(400, "Cannot delete tables which weren't created in Budibase.")
|
|
274
|
+
}
|
|
268
275
|
const datasourceId = getDatasourceId(tableToDelete)
|
|
269
276
|
|
|
270
277
|
const db = new CouchDB(appId)
|
package/src/environment.js
CHANGED
|
@@ -23,6 +23,8 @@ if (!LOADED && isDev() && !isTest()) {
|
|
|
23
23
|
LOADED = true
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
let inThread = false
|
|
27
|
+
|
|
26
28
|
module.exports = {
|
|
27
29
|
// important
|
|
28
30
|
PORT: process.env.PORT,
|
|
@@ -62,6 +64,7 @@ module.exports = {
|
|
|
62
64
|
USERID_API_KEY: process.env.USERID_API_KEY,
|
|
63
65
|
DEPLOYMENT_CREDENTIALS_URL: process.env.DEPLOYMENT_CREDENTIALS_URL,
|
|
64
66
|
ALLOW_DEV_AUTOMATIONS: process.env.ALLOW_DEV_AUTOMATIONS,
|
|
67
|
+
DISABLE_THREADING: process.env.DISABLE_THREADING,
|
|
65
68
|
_set(key, value) {
|
|
66
69
|
process.env[key] = value
|
|
67
70
|
module.exports[key] = value
|
|
@@ -72,6 +75,18 @@ module.exports = {
|
|
|
72
75
|
isProd: () => {
|
|
73
76
|
return !isDev()
|
|
74
77
|
},
|
|
78
|
+
// used to check if already in a thread, don't thread further
|
|
79
|
+
setInThread: () => {
|
|
80
|
+
inThread = true
|
|
81
|
+
},
|
|
82
|
+
isInThread: () => {
|
|
83
|
+
return inThread
|
|
84
|
+
},
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// threading can cause memory issues with node-ts in development
|
|
88
|
+
if (isDev() && module.exports.DISABLE_THREADING == null) {
|
|
89
|
+
module.exports._set("DISABLE_THREADING", "1")
|
|
75
90
|
}
|
|
76
91
|
|
|
77
92
|
// clean up any environment variable edge cases
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface IntegrationBase {
|
|
2
|
-
create?(query: any): Promise<[
|
|
3
|
-
read?(query: any): Promise<[
|
|
4
|
-
update?(query: any): Promise<[
|
|
5
|
-
delete?(query: any): Promise<[
|
|
2
|
+
create?(query: any): Promise<any[]>
|
|
3
|
+
read?(query: any): Promise<any[]>
|
|
4
|
+
update?(query: any): Promise<any[]>
|
|
5
|
+
delete?(query: any): Promise<any[]>
|
|
6
6
|
}
|
|
@@ -416,6 +416,8 @@ class SqlQueryBuilder extends SqlTableQueryBuilder {
|
|
|
416
416
|
id = results?.[0].id
|
|
417
417
|
} else if (sqlClient === SqlClients.MY_SQL) {
|
|
418
418
|
id = results?.insertId
|
|
419
|
+
} else if (sqlClient === SqlClients.ORACLE) {
|
|
420
|
+
id = response.outBinds[0][0]
|
|
419
421
|
}
|
|
420
422
|
row = processFn(
|
|
421
423
|
await this.getReturningRow(queryFn, this.checkLookupKeys(id, json))
|
|
@@ -428,4 +430,5 @@ class SqlQueryBuilder extends SqlTableQueryBuilder {
|
|
|
428
430
|
}
|
|
429
431
|
}
|
|
430
432
|
|
|
433
|
+
export default SqlQueryBuilder
|
|
431
434
|
module.exports = SqlQueryBuilder
|
|
@@ -39,6 +39,13 @@ const INTEGRATIONS = {
|
|
|
39
39
|
[SourceNames.REST]: rest.integration,
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
// optionally add oracle integration if the oracle binary can be installed
|
|
43
|
+
if (!(process.arch === 'arm64' && process.platform === 'darwin')) {
|
|
44
|
+
const oracle = require("./oracle")
|
|
45
|
+
DEFINITIONS[SourceNames.ORACLE] = oracle.schema
|
|
46
|
+
INTEGRATIONS[SourceNames.ORACLE] = oracle.integration
|
|
47
|
+
}
|
|
48
|
+
|
|
42
49
|
module.exports = {
|
|
43
50
|
definitions: DEFINITIONS,
|
|
44
51
|
integrations: INTEGRATIONS,
|