Skip to content

Sqlite Virtual Table as Datasette plugin? #1954

Answered by simonw
DavidPratten asked this question in General
Discussion options

You must be logged in to vote

Frustratingly I don't have a good pattern for this yet.

The Python standard library sqlite3 module doesn't provide a way for Python code to define virtual tables.

The apsw SQLite module DOES have this ability: https://rogerbinns.github.io/apsw/vtable.html - but Datasette doesn't yet have a way to integrate with that library. I've been pondering having pluggable database backends for Datasette which might make it easier to swap in apsw, but that's not going to make it in for Datasette 1.0 (though could be added shortly afterwards).

The other option would be to define them using C or Rust or similar (maybe with a future version of https://observablehq.com/@asg017/introducing-sqlite-loadable-rs

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by DavidPratten
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants