Allow using sqlite extensions during comptime verification
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 https://github.com/launchbadge/sqlx/issues/1460#issuecomment-929783568
This can be built on top of #3383 when it's merged. Something like:
[drivers.sqlite]
load-extensions = ["uuid", "vsv"]
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.
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?
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 https://github.com/launchbadge/sqlx/issues/3330#issuecomment-2362932640 and submitting a pull request.