Closed vrischmann closed 2 years ago
To make it work requires quite a bit of work:
How you tried solution like this:
The Go library has similar issue with Zig, the author define a bridge
header to redefine most functions of sqlite_api
, then in Go side, it only need to include bridge.h
, not sqlite3ext.h
.
I think Zig can also use this method to avoid modify sqlite3.h
and sqlite3ext.h
Add the ability to build a loadable extension (with
.load myextension.so
for example).Buliding a loadable extension is problematic with Zig because the way sqlite3ext.h works is that it redefines the sqlite API with defines, like this:
This is not supported by
translate-c
, I looked into ways to make it work but it's not straightforward:translate-c
keeps generating the code for the function defined in sqlite3.hsqlite3_api
which is not definedsqlite3_api
is defined before, the generated code fails to compile for another reason:To make it work requires quite a bit of work:
sqlite3_api
The two first steps are done with a tool which can be run like this:
The last step is easy enough but will take some time to do.