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

Loading a sqlite3 extension? #1867

Open
tyrylu opened this issue Sep 27, 2018 · 3 comments · May be fixed by #2180
Open

Loading a sqlite3 extension? #1867

tyrylu opened this issue Sep 27, 2018 · 3 comments · May be fixed by #2180
Labels

Comments

@tyrylu
Copy link

tyrylu commented Sep 27, 2018

Hello.
Did i miss something or is it really not possible (diesel 1.3) to load a sqlite3 extension? I discovered this when trying to make a spatialite initialization sequence work, but without the extension it obviously can not work. Doing a pull request exposing the APIs on SqliteConnection would probably not be as hard, but how would you go about allowing extension loading in migrations (e. g. how of a bad idea would it be to allow extension loading by default)?

@weiznich
Copy link
Member

What's wrong with sql_query("SELECT load_extension('libspatialite-2.so');").execute(&connection)? as part of your startup sequence?

@tyrylu
Copy link
Author

tyrylu commented Sep 27, 2018

This is unfortunately not enough, because at least for the windows builds it is necessary to call the enable_load_extension c function which has no sql function counterpart, without it you end up with an unauthorized error (tried a few hours ago with the bundled 3.24 version in sqlite3-sys).

sgrif added a commit that referenced this issue Oct 7, 2018
This behavior is untested since we would need to add some extensions in
order to test it.

Fixes #1867
@alamminsalo
Copy link

This would be great feature, currently I have to use a separate sqlite lib to load and query with extensions.

alamminsalo pushed a commit to alamminsalo/diesel that referenced this issue Oct 3, 2019
This behavior is untested since we would need to add some extensions in
order to test it.

Fixes diesel-rs#1867
alamminsalo pushed a commit to alamminsalo/diesel that referenced this issue Oct 3, 2019
This behavior is untested since we would need to add some extensions in
order to test it.

Fixes diesel-rs#1867
@alamminsalo alamminsalo linked a pull request Oct 4, 2019 that will close this issue
weiznich pushed a commit to alamminsalo/diesel that referenced this issue Feb 2, 2021
This behavior is untested since we would need to add some extensions in
order to test it.

Fixes diesel-rs#1867
weiznich pushed a commit to alamminsalo/diesel that referenced this issue Feb 16, 2021
This behavior is untested since we would need to add some extensions in
order to test it.

Fixes diesel-rs#1867
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants