Native drivers
Four languages, zero external dependencies, one shared parameter-escaping implementation — behavior is identical across languages.
Python (DB-API 2.0)
A drop-in replacement for code already using sqlite3/psycopg2/pymysql:
import filedb
conn = filedb.connect("http://alice:secret@localhost:8080/myapp")
cur = conn.cursor()
cur.execute("SELECT * FROM users WHERE id = ?", (42,))
print(cur.fetchone())
Go (database/sql)
Drop-in for GORM, sqlx, sqlc, and anything built on database/sql:
import _ "github.com/filedb/filedb-go"
db, _ := sql.Open("filedb", "http://alice:secret@localhost:8080/myapp")
db.QueryRow("SELECT name FROM users WHERE id = ?", 42).Scan(&name)
Node.js (async/await)
import { connect } from "filedb";
const conn = await connect("http://alice:secret@localhost:8080/myapp");
const rows = await conn.query("SELECT * FROM users WHERE id = ?", [42]);
PHP (PDO-shaped API)
Doesn't inherit from PDO, but mirrors its shape:
use FileDBConnection;
$conn = new Connection('http://localhost:8080/myapp', 'alice', 'secret');
$stmt = $conn->prepare('SELECT * FROM users WHERE id = ?');
$stmt->execute([42]);
$row = $stmt->fetch(Connection::FETCH_ASSOC);
Common gotchas
- Reuse your login token — don't re-authenticate on every request.
- For large result sets, stream the response instead of loading everything into memory.
- Working with multiple databases on one connection is done via the
dbparameter on each query, not by reconnecting.
← Previous
HTTP API