diff --git a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte
index a3531513fb..c860c7cba3 100644
--- a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte
+++ b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte
@@ -2,7 +2,7 @@
import { onMount } from "svelte"
import { get } from "svelte/store"
import { goto, params } from "@roxi/routify"
- import { BUDIBASE_INTERNAL_DB } from "constants"
+ import { BUDIBASE_INTERNAL_DB_ID } from "constants/backend"
import { database, datasources, queries, tables, views } from "stores/backend"
import EditDatasourcePopover from "./popovers/EditDatasourcePopover.svelte"
import EditQueryPopover from "./popovers/EditQueryPopover.svelte"
@@ -129,7 +129,7 @@
size="18"
/>
- {#if datasource._id !== BUDIBASE_INTERNAL_DB}
+ {#if datasource._id !== BUDIBASE_INTERNAL_DB_ID}
{/if}
diff --git a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte
index 44e592a0b1..1872a308e5 100644
--- a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte
+++ b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte
@@ -12,6 +12,10 @@
} from "@budibase/bbui"
import { datasources } from "stores/backend"
import TableDataImport from "../TableDataImport.svelte"
+ import {
+ BUDIBASE_INTERNAL_DB_ID,
+ BUDIBASE_DATASOURCE_TYPE,
+ } from "constants/backend"
import { buildAutoColumn, getAutoColumnInformation } from "builderStore/utils"
$: tableNames = $tables.list.map(table => table.name)
@@ -19,10 +23,10 @@
source => source._id === $datasources.selected
)
- $: isSelectedInternal = selectedSource?.type === "budibase"
+ $: isSelectedInternal = selectedSource?.type === BUDIBASE_DATASOURCE_TYPE
$: targetDatasourceId = isSelectedInternal
? selectedSource._id
- : "bb_internal"
+ : BUDIBASE_INTERNAL_DB_ID
export let name
let dataImport
diff --git a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExecuteQuery.svelte b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExecuteQuery.svelte
index 757f65c65f..c74613b649 100644
--- a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExecuteQuery.svelte
+++ b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/ExecuteQuery.svelte
@@ -3,7 +3,10 @@
import { datasources, integrations, queries } from "stores/backend"
import BindingBuilder from "components/integration/QueryBindingBuilder.svelte"
import IntegrationQueryEditor from "components/integration/index.svelte"
- import { BUDIBASE_DATASOURCE_ID } from "constants/backend"
+ import {
+ BUDIBASE_INTERNAL_DB_ID,
+ BUDIBASE_DATASOURCE_TYPE,
+ } from "constants/backend"
export let parameters
export let bindings = []
@@ -14,7 +17,8 @@
)
// Executequery must exclude budibase datasource
$: executeQueryDatasources = $datasources.list.filter(
- x => x._id !== BUDIBASE_DATASOURCE_ID && x.type !== "budibase"
+ x =>
+ x._id !== BUDIBASE_INTERNAL_DB_ID && x.type !== BUDIBASE_DATASOURCE_TYPE
)
function fetchQueryDefinition(query) {
diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js
index 427e8d80a1..5ecc7bc324 100644
--- a/packages/builder/src/constants/backend/index.js
+++ b/packages/builder/src/constants/backend/index.js
@@ -173,7 +173,8 @@ export const SWITCHABLE_TYPES = [
...ALLOWABLE_NUMBER_TYPES,
]
-export const BUDIBASE_DATASOURCE_ID = "bb_internal"
+export const BUDIBASE_INTERNAL_DB_ID = "bb_internal"
+export const BUDIBASE_DATASOURCE_TYPE = "budibase"
export const IntegrationTypes = {
POSTGRES: "POSTGRES",
diff --git a/packages/builder/src/constants/index.js b/packages/builder/src/constants/index.js
index 151a0cdf8d..803cafcffb 100644
--- a/packages/builder/src/constants/index.js
+++ b/packages/builder/src/constants/index.js
@@ -43,8 +43,6 @@ export const LAYOUT_NAMES = {
},
}
-export const BUDIBASE_INTERNAL_DB = "bb_internal"
-
// one or more word characters and whitespace
export const APP_NAME_REGEX = /^[\w\s]+$/
// zero or more non-whitespace characters
diff --git a/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte
index 7046614768..14eab7c41b 100644
--- a/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte
+++ b/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte
@@ -1,7 +1,7 @@