Merge pull request #7143 from Budibase/fix/executequery-datasources

filtering datasources for execute query actions
This commit is contained in:
NEOLPAR 2022-08-10 13:31:55 +01:00 committed by GitHub
commit 86489e2234
1 changed files with 8 additions and 1 deletions

View File

@ -3,6 +3,7 @@
import { datasources, integrations, queries } from "stores/backend"
import BindingBuilder from "components/integration/QueryBindingBuilder.svelte"
import IntegrationQueryEditor from "components/integration/index.svelte"
import { IntegrationTypes } from "constants/backend"
export let parameters
export let bindings = []
@ -11,6 +12,12 @@
$: datasource = $datasources.list.find(
ds => ds._id === parameters.datasourceId
)
// Executequery action just works on PostgreSQL and MongoDB datasources
$: executeQueryDatasources = $datasources.list.filter(
x =>
x.source === IntegrationTypes.POSTGRES ||
x.source === IntegrationTypes.MONGODB
)
function fetchQueryDefinition(query) {
const source = $datasources.list.find(
@ -24,7 +31,7 @@
<Select
label="Datasource"
bind:value={parameters.datasourceId}
options={$datasources.list}
options={executeQueryDatasources}
getOptionLabel={source => source.name}
getOptionValue={source => source._id}
/>