Skip to main content
The SQLite SDK allows you to create and manage SQLite databases on your Archil disk. It provides a simple interface for executing SQL queries and managing database files, enabling persistence of multi-tenant structured data for your applications. Agents can use the SQLite SDK to store and retrieve structured data in a familiar SQL format, the ability to perform complex queries during long-running sessions and retrieve relevant context on-demand.

Create and manage SQLite databases

To create a new SQLite database on your Archil disk, use the createDatabase function and pass in the disk and the name of the database file. You can then use the getDatabase function to retrieve the database later.
createDatabase will create a new SQLite database on the disk if it doesn’t exist, or return the existing database if it does. getDatabase will return an existing database.

Execute SQL queries

You can execute SQL queries against each database using the read and write methods. The read method is used for queries that return data, while the write method is used for queries that modify data.
Why is there a difference between read and write? write queries must mount the disk with a delegation to ensure it has exclusive write access to the database file, while read queries can be executed without a delegation in parallel.
You can execute multiple queries in a single transaction using the transaction method. This ensures that either all queries succeed or none of them are applied.