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
Virtual tables #100
Virtual tables #100
Conversation
fcfd042
to
a7dffbe
Compare
I've ended up with an API for
you would use the arg like this:
|
Still to do:
I'm not going to implement all the "write" functions ( For tests I'm thinking I could pass a bunch of random parameters as arguments to the virtual table creation, then since I know these parameters I can check that the rows I fetched match the rows generated. |
7926300
to
5a85395
Compare
Yes, I think we need some C stuff to glue zig code, there is a go library use similar tricks.
Hope this help you. |
Thanks ! I'll take a look at your links once I get back to working on building an extension. |
a43a3c7
to
68c1aff
Compare
68c1aff
to
6ca5a28
Compare
a6e3d39
to
da1aeda
Compare
The abiilty to build loadable extensions is part of #112 now. This PR will focus only on virtual tables. |
I'm still not 100% sure when/how to use xCreate vs xConnect and xDestroy vs xDisconnect, I think I'll implement in another PR. I'll focus next on improving tests and that will be it for this PR I think. |
212cf09
to
8ab9208
Compare
7f80988
to
acb21d1
Compare
8ab9208
to
f0bd464
Compare
c36708b
to
fff6c64
Compare
f0bd464
to
6817825
Compare
fff6c64
to
186dbeb
Compare
2ae80c4
to
6b22ec0
Compare
186dbeb
to
a4a9bdf
Compare
d0c8c5e
to
5ecebae
Compare
af7921a
to
c7aa610
Compare
700de5f
to
e414d6c
Compare
c7aa610
to
0720f39
Compare
faa0719
to
8ece266
Compare
0720f39
to
0b4f3be
Compare
This function will also be used by the virtual table implementation.
Will be used in the virtual table implementation
f3e87c3
to
2fdc9e3
Compare
2fdc9e3
to
d9d85b3
Compare
Initial work on virtual tables. The goal is to be able to easily create virtual tables using Zig and expose as little as possible of the C-ism of the raw sqlite interface.
Currently implementing a virtual table is done by providing a
Table
type which must implement the following:The cursor type must implement the following:
It's relatively complete and should largely abstract the raw sqlite interface but one thing is missing: passing the arguments to the
filter
function.SQLite gives us an array of
sqlite3_value
and I'll have to think longer on how I want to convert this to idiomatic Zig types.I'm building a demo here (not completely ready yet)