Closed lessless closed 1 month ago
So I designed ecto_sqlite3
to have the ability to swap out different sqlite backend implementations. All you need to do honestly is build a new library that implements the db_connection
interface. I believe this is how you can swap it out easily.
This would allow you to bring in your own rustler compilation process.
Some big things to consider about libsql, if at any point they diverge on the features of the SQL syntax and what is available (native json operators like psql, ltree, etc...) then we will not be able to support that with the ecto_sqlite3
implementation.
I dropped in a binary of libsql into ecto_sql and it just worked so its probably not that hard if you need this to work, fork exqlite and add the libsql amalgamation and you are good.
@jeregrine, thanks; I'll check that out. I remember having trouble building it, but I will give it another try. It brings ability to alter tables which is very worth the pursuit https://github.com/tursodatabase/libsql/blob/main/libsql-sqlite3/doc/libsql_extensions.md#altering-columns
I just needed to bring in libsql-amalgamation-0.2.2.tar.gz in place of sqlite3.h/cc and it "just worked". I'm not sure ecto_sqlite supports alter but nothing stops you from using it manually.
That is correct, ecto_sqlite
does not support alter because well, sqlite doesn't support alter 😉
Hey folks,
I can see increased interest in SQLite in my tech bubble.
Ahd that's how I learned about libSQL which offers several improvements including altering columns.
One of the project goals is to maintain 100% backwards compatibility with SQLite yet it still may deserve fork/another project, and I appreciate that it might be beyond the resources that the team currently have.
This also made me think that Exqlite may benefit from swappable backends.
update: I played a bit with libSQL and Exqlite and it seems that libSQL is a Rust project and doing it right means taking completely another route of building native extension against it with Rustler.
that followed a brief chat in Turso's Discord in the context of an already ongoing conversation which highlighted the exciting capability of embedded replications, which is definitely beyond the original SQLite scope.
Best, Yevhenii