Skip to content

Commit

Permalink
add note on error prone auto create of database
Browse files Browse the repository at this point in the history
  • Loading branch information
bhansconnect committed Dec 30, 2024
1 parent 04482b9 commit 7e24848
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/roc_sqlite/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ fn get_connection(path: &str) -> Result<SqliteConnection, SqliteError> {

let path = CString::new(path).unwrap();
let mut connection: SqliteConnection = std::ptr::null_mut();
// TODO: we should eventually allow users to decide if they want to create a database.
// This is errorprone and can lead to creating a database when the user wants to open a existing one.
let flags = libsqlite3_sys::SQLITE_OPEN_CREATE
| libsqlite3_sys::SQLITE_OPEN_READWRITE
| libsqlite3_sys::SQLITE_OPEN_NOMUTEX;
Expand Down

0 comments on commit 7e24848

Please sign in to comment.