mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 11:06:02 +00:00
21 lines
674 B
Svelte
21 lines
674 B
Svelte
<script lang="ts">
|
|
import { getFormContext } from '../forms/FormProviderCore.svelte';
|
|
import FormSelectField from '../forms/FormSelectField.svelte';
|
|
import { useDatabaseInfo, useDatabaseList } from '../utility/metadataLoaders';
|
|
|
|
export let conidName;
|
|
export let databaseName;
|
|
|
|
const { values } = getFormContext();
|
|
$: dbinfo = useDatabaseInfo({ conid: $values[conidName], database: values[databaseName] });
|
|
|
|
$: schemaOptions = (($dbinfo && $dbinfo.schemas) || []).map(schema => ({
|
|
value: schema.schemaName,
|
|
label: schema.schemaName,
|
|
}));
|
|
</script>
|
|
|
|
{#if schemaOptions.length > 0}
|
|
<FormSelectField {...$$restProps} options={schemaOptions} />
|
|
{/if}
|