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
Getting started6 min readInstall a driver, open a SQLite file, write parameterised rows, and query a task list.Upgrading to 0.411 min readUpdate a 0.3.4, 0.4.0, 0.4.1, 0.4.5, or 0.4.7 deployment for the metering, replication, transaction, encryption, client, SQL, Node.js, connection, and time-limit changes up to 0.4.8.
Core features
11 guides
Queries and transactions17 min readExecute parameterised SQL, read columns that share a name, commit related writes together, and copy the write-ahead log into the database file.Bulk load6 min readImport rows in one transaction, choose the import's durability, and handle a failure to restore the configured writer settings.Change data capture7 min readSubscribe to committed row changes, filter by row membership, capture changes through migrations, 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.Migrations12 min readApply versioned schema changes, copy a table that foreign keys refer to, verify the 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.Execution time limits8 min readStop a statement that takes too long, roll back its transaction, and recognise each refusal of a time limit.Integer fidelity4 min readPreserve SQLite integers outside JavaScript's safe number range and account for Expo's numeric limits.Writer worker6 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 backups9 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 group10 min readSelect one eligible node for each backup turn and alert on skipped captures.
Networked access
11 guides
Server18 min readServe registered database operations over HTTP and WebSocket with authentication, request limits, column reads, checkpoints, and graceful shutdown.Registered operations7 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 generation5 min readGenerate typed operation references and a registry digest from the same definitions that the server serves.Client SDK10 min readCall registered reads and writes, maintain live results, read column details, and recover WebSocket subscriptions after a disconnect.Python client13 min readCall registered reads and writes from Python, keep a query result current, read column details, and route calls across a replication group.Go client16 min readCall registered reads and writes from Go, keep a query result current, read column details, and route calls across a replication group.Value encoding over JSON6 min readPreserve large integers and binary columns over HTTP and WebSocket, with SDK, Python, and Go decoding examples.Subscription resumption7 min readResume retained changes with a sequence and epoch, and reload application state when replay is unavailable.Device sync13 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 agent6 min readSeparate agent data by database file, bound open connections, and remove a customer's files after disabling access.Memory and forgetting4 min readRecord the source of each fact, 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 agents5 min readRead agent data locally during a network outage and reconnect its database through device sync.
Distributed
3 guides
Distributed replication9 min readReplicate a database over mutual TLS, bootstrap a replica, and choose the acknowledgement and read guarantees for each call.Coordinator failover16 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 reference31 min readCheck the options, types, and defaults for databases, backups, network access, device sync, and replication.Driver options9 min readChoose a SQLite driver and check its connection, backup, encryption, row-count, column-detail, and time-limit capabilities.Encryption10 min readEncrypt a database and its backups, change the key while the database is open, and recover after an interrupted change.Security11 min readAuthorise database access, restrict subscriptions and operator routes, and protect credentials and encryption keys.Error codes23 min readIdentify Sirannon failures by code, reconcile uncertain writes, and check the HTTP status and WebSocket close codes.