Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Question]: Superset support | Attach is not persisted #1043

Open
gaurav08suri opened this issue Jul 6, 2024 · 1 comment
Open

[Question]: Superset support | Attach is not persisted #1043

gaurav08suri opened this issue Jul 6, 2024 · 1 comment

Comments

@gaurav08suri
Copy link

gaurav08suri commented Jul 6, 2024

Hello Team,

We are trying to connect Superset instance to an in-memory duckdb which will in turn attach to a Postgres Instance.
Trying to attach a postgres database to duckdb works but is not persisted.
With an example, running the below 2 queries works fine and produces the result

ATTACH 'dbname=<dbname> user=<user> host=localhost password='' port=xxxx' AS test_db (TYPE POSTGRES, READ_ONLY);
select * from test_db.public.test

However, if we execute one after the other, the second query gives an error

duckdb error: Binder Error: Catalog "test_db" does not exist!

How can we make this attach variable to persist across queries or is this an incorrect way of handling ?

The Database connection of duckdb uses an in-memory url
duckdb:///:memory:

Any help is appreciated.

Thank you

@vergenzt
Copy link

vergenzt commented Sep 24, 2024

Yeah my guess is a new in-memory duckdb connection is created each time a query is executed. You'd need to configure attachments in the duckdb connect args (#1106) for this to work in Superset.

Otherwise, you'll have to run the ATTACH command at the beginning of every SQL query you run from Superset.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants