From 5cac4dd7140ee5bc5244ebde97b9e7cb6736b2e1 Mon Sep 17 00:00:00 2001 From: qiaoyuang Date: Fri, 24 Jun 2022 23:04:33 +0800 Subject: [PATCH] Support setting lookasideSlotSize and lookasideSlotCount. --- .../kotlin/co/touchlab/sqliter/DatabaseConfiguration.kt | 4 +++- .../co/touchlab/sqliter/native/NativeDatabaseManager.kt | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sqliter-driver/src/nativeCommonMain/kotlin/co/touchlab/sqliter/DatabaseConfiguration.kt b/sqliter-driver/src/nativeCommonMain/kotlin/co/touchlab/sqliter/DatabaseConfiguration.kt index d04a0f94..e1569c64 100644 --- a/sqliter-driver/src/nativeCommonMain/kotlin/co/touchlab/sqliter/DatabaseConfiguration.kt +++ b/sqliter-driver/src/nativeCommonMain/kotlin/co/touchlab/sqliter/DatabaseConfiguration.kt @@ -48,7 +48,9 @@ data class DatabaseConfiguration( val pageSize: Int? = null, val basePath: String? = null, val synchronousFlag: SynchronousFlag? = null, - val recursiveTriggers: Boolean = false + val recursiveTriggers: Boolean = false, + val lookasideSlotSize: Int = -1, + val lookasideSlotCount: Int = -1, ) data class Logging( val logger: Logger = WarningLogger, diff --git a/sqliter-driver/src/nativeCommonMain/kotlin/co/touchlab/sqliter/native/NativeDatabaseManager.kt b/sqliter-driver/src/nativeCommonMain/kotlin/co/touchlab/sqliter/native/NativeDatabaseManager.kt index 24a9409c..2a396a44 100644 --- a/sqliter-driver/src/nativeCommonMain/kotlin/co/touchlab/sqliter/native/NativeDatabaseManager.kt +++ b/sqliter-driver/src/nativeCommonMain/kotlin/co/touchlab/sqliter/native/NativeDatabaseManager.kt @@ -49,8 +49,8 @@ class NativeDatabaseManager(private val path:String, "sqliter", false, false, - -1, - -1, + configuration.extendedConfig.lookasideSlotSize, + configuration.extendedConfig.lookasideSlotCount, configuration.extendedConfig.busyTimeout, configuration.loggingConfig.logger, configuration.loggingConfig.verboseDataCalls