Skip to content

Commit

Permalink
Update NativeDatabase.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
nbransby authored Oct 17, 2023
1 parent 3ba96b6 commit 3013a60
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ internal class NativeDatabase private constructor(val dbPointer: CPointer<sqlite
val db = memScoped {
val dbPtr = alloc<CPointerVar<sqlite3>>()
if(configuration.isReadOnly) {
//from SQLITE_OPEN_READWRITE docs: if opening in read-write mode fails due to OS-level permissions, an attempt is made to open it in read-only mode
//from sqlite3_open_v2 docs: if opening in read-write mode fails due to OS-level permissions, an attempt is made to open it in read-only mode
val openResult = sqlite3_open_v2(realPath, dbPtr.ptr, SQLITE_OPEN_READWRITE or SQLITE_OPEN_URI, null)
if (openResult == SQLITE_OK) return@memScoped dbPtr.value!!
}
Expand Down

0 comments on commit 3013a60

Please sign in to comment.