mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-12 00:06:14 +00:00
fix: ducklake default connection extra_args (#7509)
* Ducklake default extra_args * indicator nit
This commit is contained in:
@@ -20606,6 +20606,8 @@ components:
|
||||
type: string
|
||||
required:
|
||||
- path
|
||||
extra_args:
|
||||
type: string
|
||||
|
||||
DataTableSettings:
|
||||
type: object
|
||||
|
||||
@@ -213,6 +213,8 @@ pub async fn get_datatable_resource_from_db_unchecked(
|
||||
pub struct Ducklake {
|
||||
pub catalog: DucklakeCatalog,
|
||||
pub storage: DucklakeStorage,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub extra_args: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug)]
|
||||
@@ -244,6 +246,8 @@ pub struct DucklakeWithConnData {
|
||||
pub catalog: DucklakeCatalog,
|
||||
pub catalog_resource: serde_json::Value,
|
||||
pub storage: DucklakeStorage,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub extra_args: Option<String>,
|
||||
}
|
||||
|
||||
pub async fn get_ducklake_from_db_unchecked(
|
||||
@@ -287,6 +291,7 @@ pub async fn get_ducklake_from_db_unchecked(
|
||||
catalog_resource,
|
||||
catalog: ducklake.catalog,
|
||||
storage: ducklake.storage,
|
||||
extra_args: ducklake.extra_args,
|
||||
};
|
||||
Ok(ducklake)
|
||||
}
|
||||
|
||||
@@ -575,6 +575,12 @@ async fn transform_attach_ducklake(
|
||||
} else {
|
||||
format!(", OVERRIDE_DATA_PATH TRUE{extra_args}")
|
||||
};
|
||||
let extra_args = if let Some(default_extra_args) = ducklake.extra_args {
|
||||
// premise : extra_args is always non empty (and doesn't end with a comma given it's valid)
|
||||
format!("{},{}", extra_args, default_extra_args)
|
||||
} else {
|
||||
extra_args
|
||||
};
|
||||
|
||||
let attach_str = format!(
|
||||
"ATTACH 'ducklake:{db_type}:{db_conn_str}' AS {alias_name} (DATA_PATH 's3://{storage}/{data_path}'{extra_args});",
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
storage?: string
|
||||
path: string
|
||||
}
|
||||
extra_args?: string
|
||||
}[]
|
||||
}
|
||||
|
||||
@@ -42,7 +43,8 @@
|
||||
|
||||
s.ducklakes[ducklake.name] = {
|
||||
catalog: ducklake.catalog,
|
||||
storage: ducklake.storage
|
||||
storage: ducklake.storage,
|
||||
extra_args: ducklake.extra_args || undefined
|
||||
}
|
||||
}
|
||||
return s
|
||||
@@ -50,7 +52,7 @@
|
||||
</script>
|
||||
|
||||
<script>
|
||||
import { Plus } from 'lucide-svelte'
|
||||
import { Plus, SettingsIcon } from 'lucide-svelte'
|
||||
|
||||
import Button from '../common/button/Button.svelte'
|
||||
|
||||
@@ -81,6 +83,7 @@
|
||||
import { isCustomInstanceDbEnabled } from './utils.svelte'
|
||||
import { resource } from 'runed'
|
||||
import CustomInstanceDbSelect from './CustomInstanceDbSelect.svelte'
|
||||
import Label from '../Label.svelte'
|
||||
|
||||
const DEFAULT_DUCKLAKE_CATALOG_NAME = 'ducklake_catalog'
|
||||
|
||||
@@ -316,29 +319,56 @@
|
||||
</div>
|
||||
</Cell>
|
||||
<Cell class="w-12">
|
||||
{#if ducklakeIsDirty[ducklake.name]}
|
||||
<Popover
|
||||
openOnHover
|
||||
contentClasses="p-2 text-sm text-secondary italic"
|
||||
class="cursor-not-allowed"
|
||||
>
|
||||
<div class="flex gap-2">
|
||||
<Popover contentClasses="p-4" enableFlyTransition closeOnOtherPopoverOpen>
|
||||
<svelte:fragment slot="trigger">
|
||||
<ExploreAssetButton
|
||||
class="h-9"
|
||||
asset={{ kind: 'ducklake', path: ducklake.name }}
|
||||
{dbManagerDrawer}
|
||||
disabled
|
||||
/>
|
||||
<div class="relative">
|
||||
<Button variant="default" iconOnly size="sm" endIcon={{ icon: SettingsIcon }} />
|
||||
{#if ducklake.extra_args}
|
||||
<div
|
||||
class="absolute -top-0.5 -right-0.5 w-2 h-2 bg-accent rounded-full border border-surface"
|
||||
></div>
|
||||
{/if}
|
||||
</div>
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="content">
|
||||
<Label
|
||||
label="Extra args"
|
||||
tooltip="Additional arguments to pass in the ATTACH command. The argument list is substituted as-is. Separate them with commas."
|
||||
>
|
||||
<TextInput
|
||||
bind:value={ducklake.extra_args}
|
||||
class="min-w-96"
|
||||
underlyingInputEl="textarea"
|
||||
inputProps={{ placeholder: "METADATA_SCHEMA 'schema', ENCRYPTED true" }}
|
||||
/>
|
||||
</Label>
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="content">Please save settings first</svelte:fragment>
|
||||
</Popover>
|
||||
{:else}
|
||||
<ExploreAssetButton
|
||||
class="h-9"
|
||||
asset={{ kind: 'ducklake', path: ducklake.name }}
|
||||
{dbManagerDrawer}
|
||||
/>
|
||||
{/if}
|
||||
{#if ducklakeIsDirty[ducklake.name]}
|
||||
<Popover
|
||||
openOnHover
|
||||
contentClasses="p-2 text-sm text-secondary italic"
|
||||
class="cursor-not-allowed"
|
||||
>
|
||||
<svelte:fragment slot="trigger">
|
||||
<ExploreAssetButton
|
||||
class="h-9"
|
||||
asset={{ kind: 'ducklake', path: ducklake.name }}
|
||||
{dbManagerDrawer}
|
||||
disabled
|
||||
/>
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="content">Please save settings first</svelte:fragment>
|
||||
</Popover>
|
||||
{:else}
|
||||
<ExploreAssetButton
|
||||
class="h-9"
|
||||
asset={{ kind: 'ducklake', path: ducklake.name }}
|
||||
{dbManagerDrawer}
|
||||
/>
|
||||
{/if}
|
||||
</div>
|
||||
</Cell>
|
||||
<Cell class="w-12">
|
||||
<CloseButton small on:close={() => removeDucklake(ducklakeIndex)} />
|
||||
|
||||
Reference in New Issue
Block a user