Sirannon documentation
Sirannon is an open source library that puts real SQLite on every runtime, with replication, failover, offline device sync, change data capture, and a database for every user and every AI agent.
Getting started
2 guides
Core features
10 guides
Queries and transactions5 min readExecute parameterised SQL and commit related writes together with a transaction.Bulk load5 min readImport rows in one transaction, choose the import's durability, and handle a failure to restore the configured writer settings.Change data capture4 min readSubscribe to committed row changes, filter by row membership, and handle replacement writes and schema changes.Live queries6 min readMaintain a query result from committed changes and receive updates locally, over WebSocket, or through React hooks.Migrations6 min readApply versioned schema changes, verify their SQL, and share a migration set across databases and devices.SQLite extensions3 min readLoad a trusted compiled extension into a database's current and later connections.Hooks, metrics, and lifecycle5 min readGuard statements with query hooks, collect statement metrics, and open tenant databases through a restricted resolver.Usage metering5 min readMeasure the rows that SQLite reads and writes for each tenant, including failed statements and live-query reads.Integer fidelity3 min readPreserve SQLite integers outside JavaScript's safe number range and account for Expo's numeric limits.Writer worker5 min readMove SQLite writes to a worker thread and distinguish a rejected write from an uncertain outcome.
Backups
5 guides
Backups6 min readCopy an open database to a local file and repeat the copy on a schedule.Backup destinations7 min readStore backup pieces, report transfer progress, and assemble a complete database copy.Continuous backups7 min readCapture changes between full copies, inspect the backup cycle, and verify the files needed for recovery.Restoring a database6 min readSelect a restore point, rebuild the database, and find backup files that your retention policy permits you to delete.Backups in a replication group9 min readSelect one eligible node for each backup turn and alert on skipped captures.
Networked access
9 guides
Server12 min readServe registered database operations over HTTP and WebSocket with authentication, request limits, and graceful shutdown.Registered operations6 min readDefine server-side SQL, derive ownership arguments from authentication, and call reads and writes through typed references.Shared operations4 min readServe one operation set across tenant databases while authorising each database before automatic opening.Code generation4 min readGenerate typed operation references and a registry digest from the same definitions that the server serves.Client SDK6 min readCall registered reads and writes, maintain live results, and recover WebSocket subscriptions after a disconnect.Value encoding over JSON6 min readPreserve large integers and binary columns over HTTP and WebSocket, with SDK, Python, and Go decoding examples.Subscription resumption6 min readResume retained changes with a sequence and epoch, and reload application state when replay is unavailable.Device sync10 min readKeep a local database usable offline and synchronise its writes with an authenticated server.Device sync recovery7 min readLoad a first snapshot, recover an expired cursor, and keep device schemas compatible with the server.
AI agents
9 guides
Overview2 min readStore agent state, enforce tool permissions, recover unwanted changes, and search authorised notes.A database per AI agent5 min readSeparate agent data by database file, bound open connections, and remove a customer's files after disabling access.Memory and forgetting4 min readRecord where facts came from, replace current values in a transaction, and retain enough history for dated questions.Rewinding memory5 min readInspect a backup restore point, rebuild an agent database separately, and copy only later facts that an operator has approved.AI agent tools7 min readBind customer identity on the server, check row ownership in SQL, and expose registered operations as model tools.Shared state4 min readClaim work through an atomic condition and keep an agent task board current with a live query.Auditing a fleet6 min readSave audit events with agent writes, collect them in a fleet journal, and distinguish committed actions from refused requests.Retrieval with Narsil6 min readSearch an agent's notes, update the index from committed changes, and verify ownership before returning text to a model.Offline AI agents4 min readRead agent data locally during a network outage and reconnect its database through device sync.
Distributed
3 guides
Distributed replication8 min readReplicate a database over mutual TLS, bootstrap a replica, and choose the acknowledgement and read guarantees for each call.Coordinator failover8 min readDiscover peer addresses through etcd, retain node identities across restarts, and change group membership without counting an unready copy.Topology-aware routing4 min readRoute server-side reads and writes across a replication group and refresh discovered addresses after authority failures.
Operations
5 guides
Configuration reference26 min readCheck the options, types, and defaults for databases, backups, network access, device sync, and replication.Driver options5 min readChoose a SQLite driver and check its connection, backup, encryption, and row-count capabilities.Encryption9 min readEncrypt a database and its backups, change the key while the database stays open, and recover after an interrupted change.Security8 min readAuthorise database access, restrict subscriptions and operator routes, and protect credentials and encryption keys.Error codes19 min readIdentify Sirannon failures by code, reconcile uncertain writes, and check the HTTP status and WebSocket close codes.