touchlab-lab / knarch.db

K(otlin)N(ative)A(rchitecture) Database
https://touchlab.co/
Apache License 2.0
90 stars 9 forks source link

SQLiteGlobal defaultPageSize #25

Open kpgalligan opened 6 years ago

kpgalligan commented 6 years ago

We're just hard coding this, which isn't even correct according to defaults of sqlite. Should review if this is a value we want the system to be able to change at all. Current android code does a statfs to figure out block size, which would make sense.

kpgalligan commented 6 years ago

To help sort this out, see Android code here: https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/java/android/database/sqlite/SQLiteGlobal.java#L68

If iOS pretty much always has the same block size, we can probably just hard code. Default in sqlite was updated to 4k from 1k in earlier versions: https://www.sqlite.org/pragma.html#pragma_page_size