Skip to content

Commit 522a909

Browse files
cleanup requery
1 parent 458c84d commit 522a909

File tree

10 files changed

+33
-483
lines changed

10 files changed

+33
-483
lines changed

build.gradle.kts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ allprojects {
2727
maven("https://cache-redirector.jetbrains.com/intellij-dependencies")
2828
// Repo for the backported Android IntelliJ Plugin by Jetbrains used in Ultimate
2929
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-ide-plugin-dependencies/")
30-
maven("https://jitpack.io") {
31-
content { includeGroup("com.github.requery") }
32-
}
3330
}
3431

3532
configurations.configureEach {

core/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ This is a Kotlin Multiplatform project targeting Android, iOS platforms, with th
88

99
- `commonMain` - Shared code for all targets, which includes the `PowerSyncBackendConnector` interface and `PowerSyncBuilder` for building a `PowerSync` instance. It also defines
1010
the `DatabaseDriverFactory` class to be implemented in each platform.
11-
- `androidMain` - Android specific code, which includes a implementation of `DatabaseDriverFactory` class that creates an instance of `app.cash.sqldelight.driver.android.AndroidSqliteDriver` using
12-
a `io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory`. It also includes native SQLite bindings for Android.
13-
- `iosMain` - iOS specific code, which includes a implementation of `DatabaseDriverFactory` class that creates an instance of `app.cash.sqldelight.driver.native.NativeSqliteDriver` and also sets up native SQLite bindings for iOS.
11+
- `commonJDBC` - A Java SQLite driver using the [Xerial JDBC Driver](https://github.com/xerial/sqlite-jdbc). This is used by both the Android and JVM drivers.
12+
- `androidMain` - Android specific code, which includes an implementation of `DatabaseDriverFactory`.
13+
- `jvmMain` - JVM specific code which includes an implementation of `DatabaseDriverFactory`.
14+
- `iosMain` - iOS specific code, which includes am implementation of `DatabaseDriverFactory` class that creates an instance of `app.cash.sqldelight.driver.native.NativeSqliteDriver` and also sets up native SQLite bindings for iOS.
1415

1516
## Note on SQLDelight
1617

core/src/commonMain/kotlin/com/powersync/db/PowerSyncDatabaseImpl.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ internal class PowerSyncDatabaseImpl(
8080
init {
8181
runBlocking {
8282
powerSyncVersion =
83-
internalDb.get("SELECT powersync_rs_version() as version") { it.getString("version") }
83+
internalDb.get("SELECT powersync_rs_version()") { it.getString(0)!! }
8484
logger.d { "SQLiteVersion: $powerSyncVersion" }
8585
checkVersion()
8686
logger.d { "PowerSyncVersion: ${getPowerSyncVersion()}" }
@@ -336,7 +336,10 @@ internal class PowerSyncDatabaseImpl(
336336

337337
SyncedAt(
338338
priority = BucketPriority(it.getLong(0)!!.toInt()),
339-
syncedAt = LocalDateTime.parse(rawTime.replace(" ", "T")).toInstant(TimeZone.UTC),
339+
syncedAt =
340+
LocalDateTime
341+
.parse(rawTime.replace(" ", "T"))
342+
.toInstant(TimeZone.UTC),
340343
)
341344
}
342345

demos/android-supabase-todolist/settings.gradle.kts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,29 @@ dependencyResolutionManagement {
1717
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
1818
repositories {
1919
google()
20-
maven("https://jitpack.io") {
21-
content { includeGroup("com.github.requery") }
22-
}
2320
mavenCentral()
2421
}
2522
}
2623

2724
rootProject.name = "PowersyncAndroidExample"
2825
include(":app")
2926

30-
val localProperties = Properties().apply {
31-
try {
32-
load(file("local.properties").reader())
33-
} catch (ignored: java.io.IOException) {
34-
// ignore
27+
val localProperties =
28+
Properties().apply {
29+
try {
30+
load(file("local.properties").reader())
31+
} catch (ignored: java.io.IOException) {
32+
// ignore
33+
}
3534
}
36-
}
3735
val useReleasedVersions = localProperties.getProperty("USE_RELEASED_POWERSYNC_VERSIONS") == "true"
3836

3937
if (!useReleasedVersions) {
4038
includeBuild("../..") {
4139
dependencySubstitution {
4240
substitute(module("com.powersync:core"))
43-
.using(project(":core")).because("we want to auto-wire up sample dependency")
41+
.using(project(":core"))
42+
.because("we want to auto-wire up sample dependency")
4443
substitute(module("com.powersync:connector-supabase"))
4544
.using(project(":connectors:supabase"))
4645
.because("we want to auto-wire up sample dependency")

demos/hello-powersync/settings.gradle.kts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ dependencyResolutionManagement {
1515
google()
1616
mavenCentral()
1717
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
18-
maven("https://jitpack.io") {
19-
content { includeGroup("com.github.requery") }
20-
}
2118
}
2219
versionCatalogs {
2320
create("projectLibs") {
@@ -33,11 +30,13 @@ include(":composeApp")
3330
includeBuild("../..") {
3431
dependencySubstitution {
3532
substitute(module("com.powersync:core"))
36-
.using(project(":core")).because("we want to auto-wire up sample dependency")
33+
.using(project(":core"))
34+
.because("we want to auto-wire up sample dependency")
3735
substitute(module("com.powersync:connector-supabase"))
3836
.using(project(":connectors:supabase"))
3937
.because("we want to auto-wire up sample dependency")
4038
substitute(module("com.powersync:compose"))
41-
.using(project(":compose")).because("we want to auto-wire up sample dependency")
39+
.using(project(":compose"))
40+
.because("we want to auto-wire up sample dependency")
4241
}
4342
}

demos/supabase-todolist/settings.gradle.kts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,20 @@ pluginManagement {
1111
}
1212
}
1313

14-
val localProperties = Properties().apply {
15-
try {
16-
load(file("local.properties").reader())
17-
} catch (ignored: java.io.IOException) {
18-
throw Error("local.properties file not found")
14+
val localProperties =
15+
Properties().apply {
16+
try {
17+
load(file("local.properties").reader())
18+
} catch (ignored: java.io.IOException) {
19+
throw Error("local.properties file not found")
20+
}
1921
}
20-
}
2122

2223
dependencyResolutionManagement {
2324
repositories {
2425
google()
2526
mavenCentral()
2627
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
27-
maven("https://jitpack.io") {
28-
content { includeGroup("com.github.requery") }
29-
}
3028
}
3129
}
3230

@@ -46,9 +44,11 @@ if (!useReleasedVersions) {
4644
includeBuild("../..") {
4745
dependencySubstitution {
4846
substitute(module("com.powersync:core"))
49-
.using(project(":core")).because("we want to auto-wire up sample dependency")
47+
.using(project(":core"))
48+
.because("we want to auto-wire up sample dependency")
5049
substitute(module("com.powersync:persistence"))
51-
.using(project(":persistence")).because("we want to auto-wire up sample dependency")
50+
.using(project(":persistence"))
51+
.because("we want to auto-wire up sample dependency")
5252
substitute(module("com.powersync:connector-supabase"))
5353
.using(project(":connectors:supabase"))
5454
.because("we want to auto-wire up sample dependency")

gradle/libs.versions.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ sqldelight-driver-native = { module = "app.cash.sqldelight:native-driver", versi
8686
sqliter = { module = "co.touchlab:sqliter-driver", version.ref = "sqliter" }
8787
sqldelight-driver-android = { module = "app.cash.sqldelight:android-driver", version.ref = "sqlDelight" }
8888
sqldelight-driver-jdbc = { module = "app.cash.sqldelight:sqlite-driver", version.ref = "sqlDelight" }
89-
requery-sqlite-android = { module = "com.github.requery:sqlite-android", version.ref = "sqlite-android" }
9089
sqldelight-coroutines = { module = "app.cash.sqldelight:coroutines-extensions", version.ref = "sqlDelight" }
9190
sqldelight-runtime = { module = "app.cash.sqldelight:runtime", version.ref = "sqlDelight" }
9291
sqldelight-dialect-sqlite338 = { module = "app.cash.sqldelight:sqlite-3-38-dialect", version.ref = "sqlDelight" }

persistence/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ kotlin {
4141
}
4242

4343
androidMain.dependencies {
44-
api(libs.sqldelight.driver.android)
4544
api(libs.powersync.sqlite.core.android)
46-
api(libs.requery.sqlite.android)
4745
implementation(libs.androidx.sqliteFramework)
4846
}
4947

0 commit comments

Comments
 (0)