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 18a9a91dc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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}
/>