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

Allow using sqlite extensions during comptime verification #3330

Open
Suya1671 opened this issue Jul 5, 2024 · 4 comments
Open

Allow using sqlite extensions during comptime verification #3330

Suya1671 opened this issue Jul 5, 2024 · 4 comments
Labels
db:sqlite Related to SQLite enhancement New feature or request macros

Comments

@Suya1671
Copy link

Suya1671 commented Jul 5, 2024

Is your feature request related to a problem? Please describe.
I'm trying to use the uuid extension for the uuid_blob() function in sqlite. However, this errors out comptime verification since it doesn't load any extensions by default, nor is there a way to enable/add extensions at compile time.

Describe the solution you'd like
Some way to configure loading extensions during compile-time query checks. One way is to add query params to the DATABASE_URL (and also load the extensions at runtime as well), which would look something like sqlite://database.db?extension=uuid&extension=vsv

Describe alternatives you've considered
Compile sqlite with the extensions enabled by default

Additional context
seems that there were plans to do something like this in #1460 (comment)

@Suya1671 Suya1671 added the enhancement New feature or request label Jul 5, 2024
@abonander
Copy link
Collaborator

abonander commented Sep 20, 2024

This can be built on top of #3383 when it's merged. Something like:

[drivers.sqlite]
load-extensions = ["uuid", "vsv"]

@abonander abonander added db:sqlite Related to SQLite macros labels Sep 20, 2024
@djarb
Copy link

djarb commented Jan 15, 2025

That would be great! Being unable to use SQLite extensions in migrations just became a big problem for me. When using Spatialite, you have to be able to call Spatialite functions to create and delete spatial tables and build spatial indexes.

@areleu
Copy link

areleu commented Jan 27, 2025

That would be great! Being unable to use SQLite extensions in migrations just became a big problem for me. When using Spatialite, you have to be able to call Spatialite functions to create and delete spatial tables and build spatial indexes.

I am currently facing the same issue right now, have you a work-around?

@djarb
Copy link

djarb commented Jan 27, 2025

I found a partial workaround for the trouble with the migrations, but if you get past that you hit a hard stop with the compile-time checking. A way to tell SQLx to load extensions across the board is the correct solution.

My current plan is to devote time this week to implementing #3330 (comment) and submitting a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
db:sqlite Related to SQLite enhancement New feature or request macros
Projects
None yet
Development

No branches or pull requests

4 participants