Announcing Turxo! Turxo is a library (hex, git repo) for bindings to the Turso database, a SQLite compatible in-process database written in Rust. It has a number of new features over SQLite like multi-version concurrency control (MVCC), io_uring backed async I/O, edge replication, vector support and more. Turxo is the first step towards bringing these improvements to the Elixir ecosystem.
As of now we support the following operations:
- Open or create a Turso database, including in-memory databases
- Connect to an open database
- Execute SQL commands or perform queries on a connection
- Prepare reusable SQL statements, then execute or query them
Here’s a rough example copied from the README:
alias Turxo.NIF.Wrapped, as: Turso
# Open an in-memory database
{:ok, db} = Turso.db_open(":memory:")
# Establish a connection
{:ok, conn} = Turso.db_connect(db)
# Execute SQL (no parameters)
{:ok, 0} =
Turso.conn_execute(
conn,
"CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TEXT)",
[]
)
# Insert using positional parameters
{:ok, 1} =
Turso.conn_execute(conn, "INSERT INTO users (name, email) VALUES (?1, ?2)", [
"alice",
"alice@example.com"
])
# Query with positional parameters
{:ok, [["alice@example.com"]]} =
Turso.conn_query(conn, "SELECT email FROM users WHERE name = (?1)", ["alice"])
# Prepare a statement
{:ok, stmt} =
Turso.conn_prepare(conn, "INSERT INTO users (name, email) VALUES (:name, :email)", false)
# Execute the prepared statement with named parameters
{:ok, 1} = Turso.stmt_execute(stmt, name: "bob", email: "bob@example.com")
# Query with named parameters
{:ok, [["bob@example.com"]]} =
Turso.conn_query(conn, "SELECT email FROM users WHERE name = (:name)", name: "bob")
# Prepare a statement for querying
{:ok, qstmt} = Turso.conn_prepare(conn, "SELECT id, name FROM users", false)
{:ok, rows} = Turso.stmt_query(qstmt, [])
# rows = [[1, "alice"], [2, "bob"]]
As you can see, the Turxo v0.1.0 release is at a very early state with only the raw Rust bindings and lacking in docs. I decided to release it nonetheless to make it available to the public for feedback. Here are the immediate features I have on the Roadmap (PRs welcome!):
- Transactions
- DBConnection integration
- Pragmas
Particularly, I would appreciate any help in overhauling my test suite to something more robust and comprehensive than the handwritten example-like test I have now.
I also plan to write Ecto and Ash adapters in separate repositories.
Let me know any feedback you may have.






















