@budibase/server 2.1.43-alpha.3 → 2.1.43-alpha.5
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.4f2e538e.js → index.c41d7f6c.js} +229 -229
- package/builder/index.html +1 -1
- package/coverage/clover.xml +358 -351
- package/coverage/coverage-final.json +6 -6
- package/coverage/lcov-report/index.html +20 -20
- package/coverage/lcov-report/src/api/controllers/analytics.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/apikeys.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/application.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/auth.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/automation.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/backup.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/cloud.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/component.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/datasource.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/deploy/Deployment.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/deploy/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/deploy/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/dev.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/integration.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/layout.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/metadata.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/migrations.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/permission.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/plugin/file.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/plugin/github.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/plugin/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/plugin/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/plugin/npm.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/plugin/uploaders.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/plugin/url.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/plugin/utils.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/applications.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/mapping/applications.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/mapping/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/mapping/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/mapping/queries.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/mapping/rows.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/mapping/tables.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/mapping/users.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/queries.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/rows.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/tables.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/users.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/public/utils.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/sources/base/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/sources/base/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/sources/base/openapi.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/sources/curl.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/sources/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/sources/openapi2.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/import/sources/openapi3.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/query/validation.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/role.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/routing.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/ExternalRequest.ts.html +13 -4
- package/coverage/lcov-report/src/api/controllers/row/external.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/index.html +4 -4
- package/coverage/lcov-report/src/api/controllers/row/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/internal.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/internalSearch.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/staticFormula.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/row/utils.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/screen.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/script.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/static/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/static/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/table/bulkFormula.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/table/external.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/table/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/table/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/table/internal.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/table/utils.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/templates.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/user.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/view/exporters.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/view/index.html +1 -1
- package/coverage/lcov-report/src/api/controllers/view/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/view/utils.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/view/viewBuilder.ts.html +1 -1
- package/coverage/lcov-report/src/api/controllers/webhook.ts.html +1 -1
- package/coverage/lcov-report/src/api/index.html +1 -1
- package/coverage/lcov-report/src/api/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/analytics.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/apikeys.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/application.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/auth.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/automation.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/backup.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/cloud.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/component.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/datasource.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/deploy.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/dev.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/integration.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/layout.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/metadata.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/migrations.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/permission.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/plugin.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/applications.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/middleware/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/middleware/mapper.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/queries.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/rows.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/tables.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/users.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/utils/Endpoint.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/public/utils/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/query.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/role.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/routing.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/row.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/screen.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/script.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/static.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/table.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/templates.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/tests/utilities/TestFunctions.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/tests/utilities/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/tests/utilities/index.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/user.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/utils/index.html +1 -1
- package/coverage/lcov-report/src/api/routes/utils/validators.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/view.ts.html +1 -1
- package/coverage/lcov-report/src/api/routes/webhook.ts.html +1 -1
- package/coverage/lcov-report/src/app.ts.html +1 -1
- package/coverage/lcov-report/src/automations/actions.ts.html +1 -1
- package/coverage/lcov-report/src/automations/automationUtils.ts.html +1 -1
- package/coverage/lcov-report/src/automations/bullboard.ts.html +1 -1
- package/coverage/lcov-report/src/automations/index.html +1 -1
- package/coverage/lcov-report/src/automations/index.ts.html +1 -1
- package/coverage/lcov-report/src/automations/logging/index.html +1 -1
- package/coverage/lcov-report/src/automations/logging/index.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/bash.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/createRow.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/delay.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/deleteRow.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/discord.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/executeQuery.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/executeScript.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/filter.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/index.html +1 -1
- package/coverage/lcov-report/src/automations/steps/integromat.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/loop.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/outgoingWebhook.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/queryRows.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/sendSmtpEmail.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/serverLog.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/slack.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/updateRow.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/utils.ts.html +1 -1
- package/coverage/lcov-report/src/automations/steps/zapier.ts.html +1 -1
- package/coverage/lcov-report/src/automations/tests/utilities/index.html +1 -1
- package/coverage/lcov-report/src/automations/tests/utilities/index.ts.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/app.ts.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/cron.ts.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/index.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/index.ts.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/rowDeleted.ts.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/rowSaved.ts.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/rowUpdated.ts.html +1 -1
- package/coverage/lcov-report/src/automations/triggerInfo/webhook.ts.html +1 -1
- package/coverage/lcov-report/src/automations/triggers.ts.html +1 -1
- package/coverage/lcov-report/src/automations/utils.ts.html +1 -1
- package/coverage/lcov-report/src/constants/index.html +1 -1
- package/coverage/lcov-report/src/constants/index.ts.html +1 -1
- package/coverage/lcov-report/src/constants/layouts.ts.html +1 -1
- package/coverage/lcov-report/src/constants/screens.ts.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/datasource_bb_default.ts.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/employeeImport.ts.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/expensesImport.ts.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/index.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/inventoryImport.ts.html +1 -1
- package/coverage/lcov-report/src/db/defaultData/jobsImport.ts.html +1 -1
- package/coverage/lcov-report/src/db/dynamoClient.ts.html +1 -1
- package/coverage/lcov-report/src/db/inMemoryView.ts.html +1 -1
- package/coverage/lcov-report/src/db/index.html +1 -1
- package/coverage/lcov-report/src/db/index.ts.html +1 -1
- package/coverage/lcov-report/src/db/linkedRows/LinkController.ts.html +1 -1
- package/coverage/lcov-report/src/db/linkedRows/LinkDocument.ts.html +1 -1
- package/coverage/lcov-report/src/db/linkedRows/index.html +1 -1
- package/coverage/lcov-report/src/db/linkedRows/index.ts.html +1 -1
- package/coverage/lcov-report/src/db/linkedRows/linkUtils.ts.html +1 -1
- package/coverage/lcov-report/src/db/newid.ts.html +1 -1
- package/coverage/lcov-report/src/db/utils.ts.html +1 -1
- package/coverage/lcov-report/src/definitions/automations.ts.html +1 -1
- package/coverage/lcov-report/src/definitions/datasource.ts.html +1 -1
- package/coverage/lcov-report/src/definitions/index.html +1 -1
- package/coverage/lcov-report/src/environment.ts.html +1 -1
- package/coverage/lcov-report/src/events/AutomationEmitter.ts.html +1 -1
- package/coverage/lcov-report/src/events/BudibaseEmitter.ts.html +1 -1
- package/coverage/lcov-report/src/events/index.html +1 -1
- package/coverage/lcov-report/src/events/index.ts.html +1 -1
- package/coverage/lcov-report/src/events/utils.ts.html +1 -1
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/index.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/airtable.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/arangodb.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/base/index.html +1 -1
- package/coverage/lcov-report/src/integrations/base/query.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/base/sql.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/base/sqlTable.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/base/utils.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/couchdb.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/dynamodb.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/elasticsearch.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/firebase.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/googlesheets.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/index.html +30 -30
- package/coverage/lcov-report/src/integrations/index.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/microsoftSqlServer.ts.html +33 -27
- package/coverage/lcov-report/src/integrations/mongodb.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/mysql.ts.html +8 -5
- package/coverage/lcov-report/src/integrations/oracle.ts.html +40 -127
- package/coverage/lcov-report/src/integrations/postgres.ts.html +26 -8
- package/coverage/lcov-report/src/integrations/queries/index.html +1 -1
- package/coverage/lcov-report/src/integrations/queries/sql.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/redis.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/rest.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/s3.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/snowflake.ts.html +1 -1
- package/coverage/lcov-report/src/integrations/tests/TestConfiguration.js.html +1 -1
- package/coverage/lcov-report/src/integrations/tests/index.html +1 -1
- package/coverage/lcov-report/src/integrations/utils.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/appInfo.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/authorized.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/builder.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/currentapp.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/index.html +1 -1
- package/coverage/lcov-report/src/middleware/joi-validator.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/publicApi.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/resourceId.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/selfhost.ts.html +1 -1
- package/coverage/lcov-report/src/middleware/utils.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/appUrls.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app/automations.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app/datasources.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app/index.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app/layouts.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app/queries.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app/roles.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app/screens.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app/tables.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/app.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/global/configs.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/global/index.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/global/quotas.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/global/users.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/global.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/index.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/index.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/backfill/installation.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/index.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/syncQuotas.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/tableSettings.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/index.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/index.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncApps.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncPlugins.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/usageQuotas/syncRows.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/functions/userEmailViewCasing.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/index.html +1 -1
- package/coverage/lcov-report/src/migrations/index.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/tests/helpers.ts.html +1 -1
- package/coverage/lcov-report/src/migrations/tests/index.html +1 -1
- package/coverage/lcov-report/src/migrations/tests/structures.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/app/automations/index.html +1 -1
- package/coverage/lcov-report/src/sdk/app/automations/index.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/app/automations/webhook.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/app/backups/constants.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/app/backups/exports.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/app/backups/imports.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/app/backups/index.html +1 -1
- package/coverage/lcov-report/src/sdk/app/backups/index.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/app/backups/statistics.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/app/tables/index.html +1 -1
- package/coverage/lcov-report/src/sdk/app/tables/index.ts.html +1 -1
- package/coverage/lcov-report/src/sdk/index.html +1 -1
- package/coverage/lcov-report/src/sdk/index.ts.html +1 -1
- package/coverage/lcov-report/src/startup.ts.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/TestConfiguration.ts.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/controllers.ts.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/index.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/index.ts.html +1 -1
- package/coverage/lcov-report/src/tests/utilities/structures.ts.html +1 -1
- package/coverage/lcov-report/src/threads/automation.ts.html +1 -1
- package/coverage/lcov-report/src/threads/index.html +1 -1
- package/coverage/lcov-report/src/threads/index.ts.html +1 -1
- package/coverage/lcov-report/src/threads/query.ts.html +1 -1
- package/coverage/lcov-report/src/threads/utils.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/budibaseDir.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/centralPath.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/csvParser.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/fileSystem/clientLibrary.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/fileSystem/index.html +1 -1
- package/coverage/lcov-report/src/utilities/fileSystem/index.ts.html +2 -2
- package/coverage/lcov-report/src/utilities/fileSystem/processor.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/global.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/index.html +1 -1
- package/coverage/lcov-report/src/utilities/index.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/plugins.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/redis.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/routing/index.html +1 -1
- package/coverage/lcov-report/src/utilities/routing/index.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/rowProcessor/index.html +1 -1
- package/coverage/lcov-report/src/utilities/rowProcessor/index.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/rowProcessor/map.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/rowProcessor/utils.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/scriptRunner.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/security.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/statusCodes.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/usageQuota/index.html +1 -1
- package/coverage/lcov-report/src/utilities/usageQuota/rows.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/usageQuota/usageQuoteReset.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/users.ts.html +1 -1
- package/coverage/lcov-report/src/utilities/workerRequests.ts.html +1 -1
- package/coverage/lcov-report/src/watch.ts.html +1 -1
- package/coverage/lcov-report/src/websocket.ts.html +1 -1
- package/coverage/lcov.info +652 -636
- package/dist/api/controllers/row/ExternalRequest.js +2 -1
- package/dist/integrations/base/types.js +2 -0
- package/dist/integrations/microsoftSqlServer.js +8 -3
- package/dist/integrations/oracle.js +8 -1
- package/dist/integrations/postgres.js +6 -3
- package/dist/package.json +6 -6
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/scripts/integrations/mssql/data/setup.sql +3 -3
- package/scripts/integrations/postgres/emp-skill.sql +46 -0
- package/src/api/controllers/row/ExternalRequest.ts +4 -1
- package/src/integrations/base/types.ts +134 -0
- package/src/integrations/microsoftSqlServer.ts +14 -12
- package/src/integrations/mysql.ts +4 -3
- package/src/integrations/oracle.ts +17 -46
- package/src/integrations/postgres.ts +8 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.1.43-alpha.
|
|
4
|
+
"version": "2.1.43-alpha.5",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"license": "GPL-3.0",
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
46
|
-
"@budibase/backend-core": "2.1.43-alpha.
|
|
47
|
-
"@budibase/client": "2.1.43-alpha.
|
|
48
|
-
"@budibase/pro": "2.1.43-alpha.
|
|
49
|
-
"@budibase/string-templates": "2.1.43-alpha.
|
|
50
|
-
"@budibase/types": "2.1.43-alpha.
|
|
46
|
+
"@budibase/backend-core": "2.1.43-alpha.5",
|
|
47
|
+
"@budibase/client": "2.1.43-alpha.5",
|
|
48
|
+
"@budibase/pro": "2.1.43-alpha.4",
|
|
49
|
+
"@budibase/string-templates": "2.1.43-alpha.5",
|
|
50
|
+
"@budibase/types": "2.1.43-alpha.5",
|
|
51
51
|
"@bull-board/api": "3.7.0",
|
|
52
52
|
"@bull-board/koa": "3.9.4",
|
|
53
53
|
"@elastic/elasticsearch": "7.10.0",
|
|
@@ -165,5 +165,5 @@
|
|
|
165
165
|
"optionalDependencies": {
|
|
166
166
|
"oracledb": "5.3.0"
|
|
167
167
|
},
|
|
168
|
-
"gitHead": "
|
|
168
|
+
"gitHead": "0a103a9a8a2015bd60069457c1cdebed7e90f935"
|
|
169
169
|
}
|
|
@@ -11,7 +11,7 @@ GO
|
|
|
11
11
|
CREATE TABLE products
|
|
12
12
|
(
|
|
13
13
|
id int IDENTITY(1,1),
|
|
14
|
-
name varchar (20),
|
|
14
|
+
name varchar (20) NOT NULL,
|
|
15
15
|
description varchar(30),
|
|
16
16
|
CONSTRAINT pk_products PRIMARY KEY NONCLUSTERED (id)
|
|
17
17
|
);
|
|
@@ -22,7 +22,7 @@ GO
|
|
|
22
22
|
CREATE TABLE tasks
|
|
23
23
|
(
|
|
24
24
|
taskid int IDENTITY(1,1),
|
|
25
|
-
taskname varchar (20),
|
|
25
|
+
taskname varchar (20) NOT NULL,
|
|
26
26
|
productid int,
|
|
27
27
|
CONSTRAINT pk_tasks PRIMARY KEY NONCLUSTERED (taskid),
|
|
28
28
|
CONSTRAINT fk_products FOREIGN KEY (productid) REFERENCES products (id),
|
|
@@ -33,7 +33,7 @@ IF OBJECT_ID ('dbo.people', 'U') IS NOT NULL
|
|
|
33
33
|
GO
|
|
34
34
|
CREATE TABLE people
|
|
35
35
|
(
|
|
36
|
-
name varchar(30),
|
|
36
|
+
name varchar(30) NOT NULL,
|
|
37
37
|
age varchar(20),
|
|
38
38
|
CONSTRAINT pk_people PRIMARY KEY NONCLUSTERED (name, age)
|
|
39
39
|
);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
SELECT 'CREATE DATABASE main'
|
|
2
|
+
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'main')\gexec
|
|
3
|
+
|
|
4
|
+
CREATE TABLE IF NOT EXISTS public."Employee"
|
|
5
|
+
(
|
|
6
|
+
id integer NOT NULL,
|
|
7
|
+
name text COLLATE pg_catalog."default",
|
|
8
|
+
CONSTRAINT "Employee_pkey" PRIMARY KEY (id)
|
|
9
|
+
)
|
|
10
|
+
WITH (
|
|
11
|
+
OIDS = FALSE
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
INSERT INTO public."Employee" ("id", "name") VALUES (1, 'Alice');
|
|
15
|
+
INSERT INTO public."Employee" ("id", "name") VALUES (2, 'Bob');
|
|
16
|
+
CREATE TABLE IF NOT EXISTS public."Skills"
|
|
17
|
+
(
|
|
18
|
+
id integer NOT NULL,
|
|
19
|
+
name text COLLATE pg_catalog."default",
|
|
20
|
+
CONSTRAINT "Skills_pkey" PRIMARY KEY (id)
|
|
21
|
+
)
|
|
22
|
+
WITH (
|
|
23
|
+
OIDS = FALSE
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
INSERT INTO public."Skills" ("id", "name") VALUES (1, 'Docker');
|
|
27
|
+
INSERT INTO public."Skills" ("id", "name") VALUES (2, 'Microservices');
|
|
28
|
+
INSERT INTO public."Skills" ("id", "name") VALUES (3, 'Kubernetes');
|
|
29
|
+
INSERT INTO public."Skills" ("id", "name") VALUES (4, 'Spring');
|
|
30
|
+
CREATE TABLE IF NOT EXISTS public."jt_employee_skills_Skills_employee"
|
|
31
|
+
(
|
|
32
|
+
employee_id integer,
|
|
33
|
+
skills_id integer,
|
|
34
|
+
id integer NOT NULL,
|
|
35
|
+
CONSTRAINT "jt_employee_skills_Skills_employee_pkey" PRIMARY KEY (id)
|
|
36
|
+
)
|
|
37
|
+
WITH (
|
|
38
|
+
OIDS = FALSE
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
insert into public."jt_employee_skills_Skills_employee" ("id", "employee_id", "skills_id") VALUES (1, 1, 1);
|
|
42
|
+
insert into public."jt_employee_skills_Skills_employee" ("id", "employee_id", "skills_id") VALUES (2, 1, 2);
|
|
43
|
+
insert into public."jt_employee_skills_Skills_employee" ("id", "employee_id", "skills_id") VALUES (3, 1, 3);
|
|
44
|
+
insert into public."jt_employee_skills_Skills_employee" ("id", "employee_id", "skills_id") VALUES (4, 2, 2);
|
|
45
|
+
insert into public."jt_employee_skills_Skills_employee" ("id", "employee_id", "skills_id") VALUES (5, 2, 3);
|
|
46
|
+
insert into public."jt_employee_skills_Skills_employee" ("id", "employee_id", "skills_id") VALUES (6, 2, 4);
|
|
@@ -588,7 +588,10 @@ export class ExternalRequest {
|
|
|
588
588
|
for (let [colName, { isMany, rows, tableId }] of Object.entries(related)) {
|
|
589
589
|
const table: Table | undefined = this.getTable(tableId)
|
|
590
590
|
// if its not the foreign key skip it, nothing to do
|
|
591
|
-
if (
|
|
591
|
+
if (
|
|
592
|
+
!table ||
|
|
593
|
+
(!isMany && table.primary && table.primary.indexOf(colName) !== -1)
|
|
594
|
+
) {
|
|
592
595
|
continue
|
|
593
596
|
}
|
|
594
597
|
for (let row of rows) {
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
export interface MSSQLTablesResponse {
|
|
2
|
+
TABLE_CATALOG: string
|
|
3
|
+
TABLE_SCHEMA: string
|
|
4
|
+
TABLE_NAME: string
|
|
5
|
+
TABLE_TYPE: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface MSSQLColumn {
|
|
9
|
+
IS_COMPUTED: number
|
|
10
|
+
IS_IDENTITY: number
|
|
11
|
+
TABLE_CATALOG: string
|
|
12
|
+
TABLE_SCHEMA: string
|
|
13
|
+
TABLE_NAME: string
|
|
14
|
+
COLUMN_NAME: string
|
|
15
|
+
ORDINAL_POSITION: number
|
|
16
|
+
COLUMN_DEFAULT: null | any
|
|
17
|
+
IS_NULLABLE: "NO" | "YES"
|
|
18
|
+
DATA_TYPE: string
|
|
19
|
+
CHARACTER_MAXIMUM_LENGTH: null | number
|
|
20
|
+
CHARACTER_OCTET_LENGTH: null | number
|
|
21
|
+
NUMERIC_PRECISION: null | number
|
|
22
|
+
NUMERIC_PRECISION_RADIX: null | number
|
|
23
|
+
NUMERIC_SCALE: null | number
|
|
24
|
+
DATETIME_PRECISION: null | string
|
|
25
|
+
CHARACTER_SET_CATALOG: null | string
|
|
26
|
+
CHARACTER_SET_SCHEMA: null | string
|
|
27
|
+
CHARACTER_SET_NAME: null | string
|
|
28
|
+
COLLATION_CATALOG: null | string
|
|
29
|
+
COLLATION_SCHEMA: null | string
|
|
30
|
+
COLLATION_NAME: null | string
|
|
31
|
+
DOMAIN_CATALOG: null | string
|
|
32
|
+
DOMAIN_SCHEMA: null | string
|
|
33
|
+
DOMAIN_NAME: null | string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface PostgresColumn {
|
|
37
|
+
table_catalog: string
|
|
38
|
+
table_schema: string
|
|
39
|
+
table_name: string
|
|
40
|
+
column_name: string
|
|
41
|
+
ordinal_position: number
|
|
42
|
+
column_default: null | any
|
|
43
|
+
is_nullable: "NO" | "YES"
|
|
44
|
+
data_type: string
|
|
45
|
+
character_maximum_length: null | number
|
|
46
|
+
character_octet_length: null | number
|
|
47
|
+
numeric_precision: null | number
|
|
48
|
+
numeric_precision_radix: null | number
|
|
49
|
+
numeric_scale: null | number
|
|
50
|
+
datetime_precision: null | string
|
|
51
|
+
interval_type: null | string
|
|
52
|
+
interval_precision: null | string
|
|
53
|
+
character_set_catalog: null | string
|
|
54
|
+
character_set_schema: null | string
|
|
55
|
+
character_set_name: null | string
|
|
56
|
+
collation_catalog: null | string
|
|
57
|
+
collation_schema: null | string
|
|
58
|
+
collation_name: null | string
|
|
59
|
+
domain_catalog: null | string
|
|
60
|
+
domain_schema: null | string
|
|
61
|
+
domain_name: null | string
|
|
62
|
+
udt_catalog: string
|
|
63
|
+
udt_schema: string
|
|
64
|
+
udt_name: string
|
|
65
|
+
scope_catalog: null | string
|
|
66
|
+
scope_schema: null | string
|
|
67
|
+
scope_name: null | string
|
|
68
|
+
maximum_cardinality: null | string
|
|
69
|
+
dtd_identifier: string
|
|
70
|
+
is_self_referencing: "NO" | "YES"
|
|
71
|
+
is_identity: "NO" | "YES"
|
|
72
|
+
identity_generation: null | number
|
|
73
|
+
identity_start: null | number
|
|
74
|
+
identity_increment: null | number
|
|
75
|
+
identity_maximum: null | number
|
|
76
|
+
identity_minimum: null | number
|
|
77
|
+
identity_cycle: "NO" | "YES"
|
|
78
|
+
is_generated: "NEVER"
|
|
79
|
+
generation_expression: null | string
|
|
80
|
+
is_updatable: "NO" | "YES"
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface MySQLColumn {
|
|
84
|
+
Field: string
|
|
85
|
+
Type: string
|
|
86
|
+
Null: "NO" | "YES"
|
|
87
|
+
Key: "PRI" | "MUL" | ""
|
|
88
|
+
Default: null | any
|
|
89
|
+
Extra: null | string
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Raw query response
|
|
94
|
+
*/
|
|
95
|
+
export interface OracleColumnsResponse {
|
|
96
|
+
TABLE_NAME: string
|
|
97
|
+
COLUMN_NAME: string
|
|
98
|
+
DATA_TYPE: string
|
|
99
|
+
DATA_DEFAULT: null | string
|
|
100
|
+
COLUMN_ID: number
|
|
101
|
+
CONSTRAINT_NAME: null | string
|
|
102
|
+
CONSTRAINT_TYPE: null | string
|
|
103
|
+
R_CONSTRAINT_NAME: null | string
|
|
104
|
+
SEARCH_CONDITION: null | string
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* An oracle constraint
|
|
109
|
+
*/
|
|
110
|
+
export interface OracleConstraint {
|
|
111
|
+
name: string
|
|
112
|
+
type: string
|
|
113
|
+
relatedConstraintName: null | string
|
|
114
|
+
searchCondition: null | string
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* An oracle column and it's related constraints
|
|
119
|
+
*/
|
|
120
|
+
export interface OracleColumn {
|
|
121
|
+
name: string
|
|
122
|
+
type: string
|
|
123
|
+
default: null | string
|
|
124
|
+
id: number
|
|
125
|
+
constraints: { [key: string]: OracleConstraint }
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* An oracle table and it's related columns
|
|
130
|
+
*/
|
|
131
|
+
export interface OracleTable {
|
|
132
|
+
name: string
|
|
133
|
+
columns: { [key: string]: OracleColumn }
|
|
134
|
+
}
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
SqlClient,
|
|
18
18
|
} from "./utils"
|
|
19
19
|
import Sql from "./base/sql"
|
|
20
|
+
import { MSSQLTablesResponse, MSSQLColumn } from "./base/types"
|
|
20
21
|
|
|
21
22
|
const sqlServer = require("mssql")
|
|
22
23
|
const DEFAULT_SCHEMA = "dbo"
|
|
@@ -31,13 +32,6 @@ interface MSSQLConfig {
|
|
|
31
32
|
encrypt?: boolean
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
interface TablesResponse {
|
|
35
|
-
TABLE_CATALOG: string
|
|
36
|
-
TABLE_SCHEMA: string
|
|
37
|
-
TABLE_NAME: string
|
|
38
|
-
TABLE_TYPE: string
|
|
39
|
-
}
|
|
40
|
-
|
|
41
35
|
const SCHEMA: Integration = {
|
|
42
36
|
docs: "https://github.com/tediousjs/node-mssql",
|
|
43
37
|
plus: true,
|
|
@@ -210,7 +204,7 @@ class SqlServerIntegration extends Sql implements DatasourcePlus {
|
|
|
210
204
|
*/
|
|
211
205
|
async buildSchema(datasourceId: string, entities: Record<string, Table>) {
|
|
212
206
|
await this.connect()
|
|
213
|
-
let tableInfo:
|
|
207
|
+
let tableInfo: MSSQLTablesResponse[] = await this.runSQL(this.TABLES_SQL)
|
|
214
208
|
if (tableInfo == null || !Array.isArray(tableInfo)) {
|
|
215
209
|
throw "Unable to get list of tables in database"
|
|
216
210
|
}
|
|
@@ -228,15 +222,20 @@ class SqlServerIntegration extends Sql implements DatasourcePlus {
|
|
|
228
222
|
// find primary key constraints
|
|
229
223
|
const constraints = await this.runSQL(this.getConstraintsSQL(tableName))
|
|
230
224
|
// find the computed and identity columns (auto columns)
|
|
231
|
-
const columns = await this.runSQL(
|
|
225
|
+
const columns: MSSQLColumn[] = await this.runSQL(
|
|
226
|
+
this.getAutoColumnsSQL(tableName)
|
|
227
|
+
)
|
|
232
228
|
const primaryKeys = constraints
|
|
233
229
|
.filter(
|
|
234
230
|
(constraint: any) => constraint.CONSTRAINT_TYPE === "PRIMARY KEY"
|
|
235
231
|
)
|
|
236
232
|
.map((constraint: any) => constraint.COLUMN_NAME)
|
|
237
233
|
const autoColumns = columns
|
|
238
|
-
.filter(
|
|
239
|
-
.map(
|
|
234
|
+
.filter(col => col.IS_COMPUTED || col.IS_IDENTITY)
|
|
235
|
+
.map(col => col.COLUMN_NAME)
|
|
236
|
+
const requiredColumns = columns
|
|
237
|
+
.filter(col => col.IS_NULLABLE === "NO")
|
|
238
|
+
.map(col => col.COLUMN_NAME)
|
|
240
239
|
|
|
241
240
|
let schema: TableSchema = {}
|
|
242
241
|
for (let def of definition) {
|
|
@@ -245,8 +244,11 @@ class SqlServerIntegration extends Sql implements DatasourcePlus {
|
|
|
245
244
|
continue
|
|
246
245
|
}
|
|
247
246
|
schema[name] = {
|
|
248
|
-
autocolumn: !!autoColumns.find(
|
|
247
|
+
autocolumn: !!autoColumns.find(col => col === name),
|
|
249
248
|
name: name,
|
|
249
|
+
constraints: {
|
|
250
|
+
presence: requiredColumns.find(col => col === name),
|
|
251
|
+
},
|
|
250
252
|
...convertSqlType(def.DATA_TYPE),
|
|
251
253
|
externalType: def.DATA_TYPE,
|
|
252
254
|
}
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
import dayjs from "dayjs"
|
|
19
19
|
const { NUMBER_REGEX } = require("../utilities")
|
|
20
20
|
import Sql from "./base/sql"
|
|
21
|
+
import { MySQLColumn } from "./base/types"
|
|
21
22
|
|
|
22
23
|
const mysql = require("mysql2/promise")
|
|
23
24
|
|
|
@@ -203,11 +204,11 @@ class MySQLIntegration extends Sql implements DatasourcePlus {
|
|
|
203
204
|
|
|
204
205
|
try {
|
|
205
206
|
// get the tables first
|
|
206
|
-
const tablesResp = await this.internalQuery(
|
|
207
|
+
const tablesResp: Record<string, string>[] = await this.internalQuery(
|
|
207
208
|
{ sql: "SHOW TABLES;" },
|
|
208
209
|
{ connect: false }
|
|
209
210
|
)
|
|
210
|
-
const tableNames = tablesResp.map(
|
|
211
|
+
const tableNames: string[] = tablesResp.map(
|
|
211
212
|
(obj: any) =>
|
|
212
213
|
obj[`Tables_in_${database}`] ||
|
|
213
214
|
obj[`Tables_in_${database.toLowerCase()}`]
|
|
@@ -215,7 +216,7 @@ class MySQLIntegration extends Sql implements DatasourcePlus {
|
|
|
215
216
|
for (let tableName of tableNames) {
|
|
216
217
|
const primaryKeys = []
|
|
217
218
|
const schema: TableSchema = {}
|
|
218
|
-
const descResp = await this.internalQuery(
|
|
219
|
+
const descResp: MySQLColumn[] = await this.internalQuery(
|
|
219
220
|
{ sql: `DESCRIBE \`${tableName}\`;` },
|
|
220
221
|
{ connect: false }
|
|
221
222
|
)
|
|
@@ -24,6 +24,12 @@ import {
|
|
|
24
24
|
ExecuteOptions,
|
|
25
25
|
Result,
|
|
26
26
|
} from "oracledb"
|
|
27
|
+
import {
|
|
28
|
+
OracleTable,
|
|
29
|
+
OracleColumn,
|
|
30
|
+
OracleColumnsResponse,
|
|
31
|
+
OracleConstraint,
|
|
32
|
+
} from "./base/types"
|
|
27
33
|
let oracledb: any
|
|
28
34
|
try {
|
|
29
35
|
oracledb = require("oracledb")
|
|
@@ -89,50 +95,6 @@ const SCHEMA: Integration = {
|
|
|
89
95
|
|
|
90
96
|
const UNSUPPORTED_TYPES = ["BLOB", "CLOB", "NCLOB"]
|
|
91
97
|
|
|
92
|
-
/**
|
|
93
|
-
* Raw query response
|
|
94
|
-
*/
|
|
95
|
-
interface ColumnsResponse {
|
|
96
|
-
TABLE_NAME: string
|
|
97
|
-
COLUMN_NAME: string
|
|
98
|
-
DATA_TYPE: string
|
|
99
|
-
DATA_DEFAULT: string | null
|
|
100
|
-
COLUMN_ID: number
|
|
101
|
-
CONSTRAINT_NAME: string | null
|
|
102
|
-
CONSTRAINT_TYPE: string | null
|
|
103
|
-
R_CONSTRAINT_NAME: string | null
|
|
104
|
-
SEARCH_CONDITION: string | null
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* An oracle constraint
|
|
109
|
-
*/
|
|
110
|
-
interface OracleConstraint {
|
|
111
|
-
name: string
|
|
112
|
-
type: string
|
|
113
|
-
relatedConstraintName: string | null
|
|
114
|
-
searchCondition: string | null
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* An oracle column and it's related constraints
|
|
119
|
-
*/
|
|
120
|
-
interface OracleColumn {
|
|
121
|
-
name: string
|
|
122
|
-
type: string
|
|
123
|
-
default: string | null
|
|
124
|
-
id: number
|
|
125
|
-
constraints: { [key: string]: OracleConstraint }
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* An oracle table and it's related columns
|
|
130
|
-
*/
|
|
131
|
-
interface OracleTable {
|
|
132
|
-
name: string
|
|
133
|
-
columns: { [key: string]: OracleColumn }
|
|
134
|
-
}
|
|
135
|
-
|
|
136
98
|
const OracleContraintTypes = {
|
|
137
99
|
PRIMARY: "P",
|
|
138
100
|
NOT_NULL_OR_CHECK: "C",
|
|
@@ -195,7 +157,7 @@ class OracleIntegration extends Sql implements DatasourcePlus {
|
|
|
195
157
|
/**
|
|
196
158
|
* Map the flat tabular columns and constraints data into a nested object
|
|
197
159
|
*/
|
|
198
|
-
private mapColumns(result: Result<
|
|
160
|
+
private mapColumns(result: Result<OracleColumnsResponse>): {
|
|
199
161
|
[key: string]: OracleTable
|
|
200
162
|
} {
|
|
201
163
|
const oracleTables: { [key: string]: OracleTable } = {}
|
|
@@ -299,7 +261,7 @@ class OracleIntegration extends Sql implements DatasourcePlus {
|
|
|
299
261
|
* @param entities - the tables that are to be built
|
|
300
262
|
*/
|
|
301
263
|
async buildSchema(datasourceId: string, entities: Record<string, Table>) {
|
|
302
|
-
const columnsResponse = await this.internalQuery<
|
|
264
|
+
const columnsResponse = await this.internalQuery<OracleColumnsResponse>({
|
|
303
265
|
sql: this.COLUMNS_SQL,
|
|
304
266
|
})
|
|
305
267
|
const oracleTables = this.mapColumns(columnsResponse)
|
|
@@ -334,6 +296,9 @@ class OracleIntegration extends Sql implements DatasourcePlus {
|
|
|
334
296
|
fieldSchema = {
|
|
335
297
|
autocolumn: OracleIntegration.isAutoColumn(oracleColumn),
|
|
336
298
|
name: columnName,
|
|
299
|
+
constraints: {
|
|
300
|
+
presence: false,
|
|
301
|
+
},
|
|
337
302
|
...this.internalConvertType(oracleColumn),
|
|
338
303
|
}
|
|
339
304
|
table.schema[columnName] = fieldSchema
|
|
@@ -343,6 +308,12 @@ class OracleIntegration extends Sql implements DatasourcePlus {
|
|
|
343
308
|
Object.values(oracleColumn.constraints).forEach(oracleConstraint => {
|
|
344
309
|
if (oracleConstraint.type === OracleContraintTypes.PRIMARY) {
|
|
345
310
|
table.primary!.push(columnName)
|
|
311
|
+
} else if (
|
|
312
|
+
oracleConstraint.type === OracleContraintTypes.NOT_NULL_OR_CHECK
|
|
313
|
+
) {
|
|
314
|
+
table.schema[columnName].constraints = {
|
|
315
|
+
presence: true,
|
|
316
|
+
}
|
|
346
317
|
}
|
|
347
318
|
})
|
|
348
319
|
})
|
|
@@ -15,9 +15,10 @@ import {
|
|
|
15
15
|
SqlClient,
|
|
16
16
|
} from "./utils"
|
|
17
17
|
import Sql from "./base/sql"
|
|
18
|
+
import { PostgresColumn } from "./base/types"
|
|
19
|
+
import { escapeDangerousCharacters } from "../utilities"
|
|
18
20
|
|
|
19
21
|
const { Client, types } = require("pg")
|
|
20
|
-
const { escapeDangerousCharacters } = require("../utilities")
|
|
21
22
|
|
|
22
23
|
// Return "date" and "timestamp" types as plain strings.
|
|
23
24
|
// This lets us reference the original stored timezone.
|
|
@@ -237,7 +238,8 @@ class PostgresIntegration extends Sql implements DatasourcePlus {
|
|
|
237
238
|
}
|
|
238
239
|
|
|
239
240
|
try {
|
|
240
|
-
const columnsResponse
|
|
241
|
+
const columnsResponse: { rows: PostgresColumn[] } =
|
|
242
|
+
await this.client.query(this.COLUMNS_SQL)
|
|
241
243
|
|
|
242
244
|
const tables: { [key: string]: Table } = {}
|
|
243
245
|
|
|
@@ -260,6 +262,9 @@ class PostgresIntegration extends Sql implements DatasourcePlus {
|
|
|
260
262
|
column.identity_start ||
|
|
261
263
|
column.identity_increment
|
|
262
264
|
)
|
|
265
|
+
const constraints = {
|
|
266
|
+
presence: column.is_nullable === "NO",
|
|
267
|
+
}
|
|
263
268
|
const hasDefault =
|
|
264
269
|
typeof column.column_default === "string" &&
|
|
265
270
|
column.column_default.startsWith("nextval")
|
|
@@ -269,6 +274,7 @@ class PostgresIntegration extends Sql implements DatasourcePlus {
|
|
|
269
274
|
tables[tableName].schema[columnName] = {
|
|
270
275
|
autocolumn: isAuto,
|
|
271
276
|
name: columnName,
|
|
277
|
+
constraints,
|
|
272
278
|
...convertSqlType(column.data_type),
|
|
273
279
|
externalType: column.data_type,
|
|
274
280
|
}
|