diff --git a/sqlx-core/src/sqlite/connection/establish.rs b/sqlx-core/src/sqlite/connection/establish.rs index 4c640bfb..d955cf23 100644 --- a/sqlx-core/src/sqlite/connection/establish.rs +++ b/sqlx-core/src/sqlite/connection/establish.rs @@ -4,7 +4,7 @@ use std::ptr::{null, null_mut}; use libsqlite3_sys::{ sqlite3_busy_timeout, sqlite3_extended_result_codes, sqlite3_open_v2, SQLITE_OK, SQLITE_OPEN_CREATE, SQLITE_OPEN_MEMORY, SQLITE_OPEN_NOMUTEX, SQLITE_OPEN_PRIVATECACHE, - SQLITE_OPEN_READWRITE, + SQLITE_OPEN_READONLY, SQLITE_OPEN_READWRITE, }; use sqlx_rt::blocking; @@ -33,8 +33,14 @@ pub(super) async fn establish(options: &SqliteConnectOptions) -> Result Self { + self.read_only = read_only; + self + } + /// Sets the capacity of the connection's statement cache in a number of stored /// distinct statements. Caching is handled using LRU, meaning when the /// amount of queries hits the defined limit, the oldest statement will get