-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable WAL for GeoPackage databases.
- Loading branch information
1 parent
01a54aa
commit 6aec857
Showing
3 changed files
with
7 additions
and
13 deletions.
There are no files selected for viewing
7 changes: 5 additions & 2 deletions
7
worldwind/src/androidMain/kotlin/earth/worldwind/util/ormlite/ConnectionSource.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
package earth.worldwind.util.ormlite | ||
|
||
import android.database.sqlite.SQLiteDatabase | ||
import android.database.sqlite.SQLiteDatabase.* | ||
import com.j256.ormlite.android.AndroidConnectionSource | ||
import com.j256.ormlite.support.ConnectionSource | ||
|
||
actual fun initConnection(pathName: String, readOnly: Boolean): ConnectionSource = AndroidConnectionSource( | ||
SQLiteDatabase.openDatabase(pathName, null, if (readOnly) SQLiteDatabase.OPEN_READONLY else SQLiteDatabase.OPEN_READWRITE or SQLiteDatabase.CREATE_IF_NECESSARY) | ||
openDatabase( | ||
pathName, null, | ||
if (readOnly) OPEN_READONLY else OPEN_READWRITE or CREATE_IF_NECESSARY or ENABLE_WRITE_AHEAD_LOGGING | ||
).also { it.execSQL("PRAGMA synchronous = NORMAL") } | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters