How to attach with a secret for a PostgreSQL metadata server and custom schema? #315
-
The DuckLake 0.2 docs show that it's possible to connect using a secret containing the required information to set up a connection. How do I do this for a PostgreSQL metadata server with a custom schema name? For example, the following works without a secret. attach 'ducklake:postgres:dbname=postgres host=127.0.0.1 user=postgres password=password'
as my_ducklake (metadata_schema 'some_schema'); But, using a secret, it seems to ignore the create or replace secret my_ducklake_secret (
type ducklake,
metadata_path 'ducklake:postgres:dbname=postgres host=127.0.0.1 user=postgres password=password'
);
attach 'ducklake:my_ducklake_secret' (metadata_schema 'some_schema'); |
Beta Was this translation helpful? Give feedback.
Answered by
lostmygithubaccount
Jul 23, 2025
Replies: 1 comment 1 reply
-
does this help? I use this script for connecting to the metadata DB directly + DuckLake "DB" in SQL #!/usr/bin/env duckdb -init
install ducklake;
install postgres;
create secret my_postgres (
type postgres,
host '127.0.0.1',
port 5432,
database 'postgres',
user 'postgres',
password 'password'
);
create secret my_ducklake (
type ducklake,
metadata_path '',
metadata_schema 'some_schema',
data_path '/Users/cody/my_lake',
metadata_parameters map {'TYPE': 'postgres', 'SECRET': 'my_postgres'}
);
attach '' as metadata (type postgres, schema 'some_schema', secret 'my_postgres');
attach 'ducklake:my_ducklake' as data;
use data; |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
kinghuang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
does this help? I use this script for connecting to the metadata DB directly + DuckLake "DB" in SQL