Create and manage SQLite databases
To create a new SQLite database on your Archil disk, use thecreateDatabase 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 theread 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.transaction method. This ensures that either all queries succeed or none of them are applied.