Catalog creation - DuckDB #10536
Replies: 1 comment
-
DuckDB supports the notion of catalogs but you can't have multiple catalogs in a given DuckDB file -- each file (or resource) corresponds to an individual catalog. In DuckDB SQL you can do We wouldn't expose this as We do have the Reference docs are here: https://duckdb.org/docs/sql/statements/attach.html |
Beta Was this translation helpful? Give feedback.
-
Hi Team,
is there a way/workaround to create catalogs for DuckDB backend?
We noticed that, for
duckdb.Backend
, we havecreate_database
,create_table
,create_view
. However, we do not see any support for creating catalogs.To give more context:
Here is our requirement or what we are trying to do:
We have two individual backends: Trino and DuckDB
Let’s assume we have a Trino executable/compatible SQL(following trino’s catalog/schema/tables structure) as below:
We would like to have the same SQL to be executed for DuckDB backend as well, given we have DuckDB setup. We are able to achieve this using the following code:
However, there may be a case where we have multiple catalogs in the SQL query:
In order for us to use the above SQL on DuckDB, we need the support for creating catalogs in DuckDB.
Please feel free to suggest if there is any better/alternative way to achieve this. TIA!
Beta Was this translation helpful? Give feedback.
All reactions