Merge pull request #7143 from Budibase/fix/executequery-datasources
filtering datasources for execute query actions
This commit is contained in:
commit
86489e2234
|
@ -3,6 +3,7 @@
|
||||||
import { datasources, integrations, queries } from "stores/backend"
|
import { datasources, integrations, queries } from "stores/backend"
|
||||||
import BindingBuilder from "components/integration/QueryBindingBuilder.svelte"
|
import BindingBuilder from "components/integration/QueryBindingBuilder.svelte"
|
||||||
import IntegrationQueryEditor from "components/integration/index.svelte"
|
import IntegrationQueryEditor from "components/integration/index.svelte"
|
||||||
|
import { IntegrationTypes } from "constants/backend"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
export let bindings = []
|
export let bindings = []
|
||||||
|
@ -11,6 +12,12 @@
|
||||||
$: datasource = $datasources.list.find(
|
$: datasource = $datasources.list.find(
|
||||||
ds => ds._id === parameters.datasourceId
|
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) {
|
function fetchQueryDefinition(query) {
|
||||||
const source = $datasources.list.find(
|
const source = $datasources.list.find(
|
||||||
|
@ -24,7 +31,7 @@
|
||||||
<Select
|
<Select
|
||||||
label="Datasource"
|
label="Datasource"
|
||||||
bind:value={parameters.datasourceId}
|
bind:value={parameters.datasourceId}
|
||||||
options={$datasources.list}
|
options={executeQueryDatasources}
|
||||||
getOptionLabel={source => source.name}
|
getOptionLabel={source => source.name}
|
||||||
getOptionValue={source => source._id}
|
getOptionValue={source => source._id}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue