Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Bug]: preload_extensions doesn't INSTALL first #825

Open
1 task done
tboddyspargo opened this issue Nov 9, 2023 · 4 comments
Open
1 task done

[Bug]: preload_extensions doesn't INSTALL first #825

tboddyspargo opened this issue Nov 9, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@tboddyspargo
Copy link

tboddyspargo commented Nov 9, 2023

What happened?

Thanks for this convenient sqlalchemy extension, @Mause!

I appreciate the preload_extensions and config options to facilitate extension loading and connection configuration when connections are started. It reduces the boilerplate that's necessary before we can start simply executing queries.

I realize that preload_extensions is just "experimental," but I think it may provide value into the future given that some extensions are not yet "autoloadable" (e.g. spatial) and presumably there will always be the possibility of 3rd party extensions that aren't.

In order to support those cases, I think you may need to ensure that INSTALL {extension} is run before LOAD {extension} to avoid errors like this:

OperationalError: duckdb.duckdb.IOException: IO Error: Extension "/home/user/.duckdb/extensions/v0.9.1/linux_amd64_gcc4/spatial.duckdb_extension" not found.
Extension "spatial" is an existing extension.
Install it first using "INSTALL spatial".

DuckDB Engine Version

0.9.2

DuckDB Version

0.9.1

SQLAlchemy Version

1.4.46

Relevant log output

OperationalError: duckdb.duckdb.IOException: IO Error: Extension "/home/user/.duckdb/extensions/v0.9.1/linux_amd64_gcc4/spatial.duckdb_extension" not found.
Extension "spatial" is an existing extension.
Install it first using "INSTALL spatial".

Code of Conduct

  • I agree to follow this project's Code of Conduct
@tboddyspargo tboddyspargo added the bug Something isn't working label Nov 9, 2023
@Mause
Copy link
Owner

Mause commented Dec 21, 2023

Hey there, this has been raised before, but the landscape has changed a bit since.

We'd probably need a list[str | dict] or something I think? Will have a think

@tboddyspargo
Copy link
Author

We'd probably need a list[str | dict] or something I think? Will have a think

Would the dict option be used to support key-value pairs of extension name and URLs from which to install them?

for k,v in preload_extensions.items():
    conn.execute(f"INSTALL {k} FROM {v}")

I hadn't considered that, but it would make sense. I wasn't familiar with that installation syntax.

I imagine str would be used for the default install url or path-based installs, I think:

for e in preload_extensions:
    conn.execute(f"INSTALL {e}")

Are there any other install syntaxes to consider?

@Mause
Copy link
Owner

Mause commented Feb 3, 2024

Version support is incoming as well: duckdb/duckdb#10437

@Mause
Copy link
Owner

Mause commented Apr 16, 2024

duckdb/duckdb#11677

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants