Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.dart_tool
target
turso
*.g.dart
207 changes: 207 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ serde_json = "1.0.134"
tokio = { version = "1.42.0", features = ["rt-multi-thread"] }
reqwest = { version = "0.12.9", features = ["json", "blocking", "gzip"] }
num_cpus = "1.17.0"
tokio-tungstenite = { version = "0.27.0", features = ["native-tls"] }
futures-util = "0.3.31"
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# libsqlite-turso

A rewrite for `libsqlite3.so` dynamic library that allows any SQLite client to seamlessly connect to [Turso](https://turso.tech/) or LibSQL databases — with zero client-side changes.

This project provides drop-in `libsqlite3.so` support with automatic strategy selection depending on runtime context.

## ✨ Features

- ✅ Works with **any SQLite client** that uses `libsqlite3.so`
- 🔁 Supports both `Http` & `Websocket` protocol for LibSQL
- 🔌 No custom SQLite client logic or [Hrana](https://github.com/tursodatabase/libsql/blob/main/docs/HRANA_3_SPEC.md) knowledge required

---

## 🔧 Setup

### 1. Build the custom `libsqlite3.so`

```bash
cargo build --release
```

### 2. Place `libsqlite3.so` in your system

This project assumes `libsqlite3.so` is available at runtime.

Place it in a standard library path (e.g., `/usr/lib`, or use `/usr/local/lib/`).

---

## 🚀 Usage

Use **any standard SQLite library** in your language/runtime — this project handles the dynamic strategy and connection logic under the hood.
2 changes: 1 addition & 1 deletion src/auth.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{future::Future, pin::Pin};

use crate::utils::TursoConfig;
use crate::transport::TursoConfig;

pub trait DbAuthStrategy {
fn resolve<'a>(
Expand Down
Loading