Skip to content

Commit 82880a4

Browse files
committed
Prepare for Kotlin common module
1 parent 2eb513b commit 82880a4

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

Package.resolved

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.7
1+
// swift-tools-version: 6.1
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
@@ -18,14 +18,20 @@ let localCoreExtension: String? = nil
1818
// a binary target.
1919
// With a local SDK, we point to a `Package.swift` within the Kotlin SDK containing a target pointing
2020
// towards a local framework build
21-
var conditionalDependencies: [Package.Dependency] = []
21+
var conditionalDependencies: [Package.Dependency] = [
22+
.package(
23+
url: "https://github.com/sbooth/CSQLite.git",
24+
from: "3.50.4",
25+
traits: ["ENABLE_SESSION"]
26+
)
27+
]
2228
var conditionalTargets: [Target] = []
2329
var kotlinTargetDependency = Target.Dependency.target(name: "PowerSyncKotlin")
2430

2531
if let kotlinSdkPath = localKotlinSdkOverride {
2632
// We can't depend on local XCFrameworks outside of this project's root, so there's a Package.swift
2733
// in the PowerSyncKotlin project pointing towards a local build.
28-
conditionalDependencies.append(.package(path: "\(kotlinSdkPath)/PowerSyncKotlin"))
34+
conditionalDependencies.append(.package(path: "\(kotlinSdkPath)/internal/PowerSyncKotlin"))
2935

3036
kotlinTargetDependency = .product(name: "PowerSyncKotlin", package: "PowerSyncKotlin")
3137
} else {
@@ -81,7 +87,8 @@ let package = Package(
8187
name: packageName,
8288
dependencies: [
8389
kotlinTargetDependency,
84-
.product(name: "PowerSyncSQLiteCore", package: corePackageName)
90+
.product(name: "PowerSyncSQLiteCore", package: corePackageName),
91+
.product(name: "CSQLite", package: "CSQLite")
8592
]
8693
),
8794
.testTarget(

Sources/PowerSync/Kotlin/KotlinPowerSyncDatabaseImpl.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class KotlinPowerSyncDatabaseImpl: PowerSyncDatabaseProtocol,
1515
dbFilename: String,
1616
logger: DatabaseLogger
1717
) {
18-
let factory = PowerSyncKotlin.DatabaseDriverFactory()
18+
let factory = sqlite3DatabaseFactory(initialStatements: [])
1919
kotlinDatabase = PowerSyncDatabase(
2020
factory: factory,
2121
schema: KotlinAdapter.Schema.toKotlin(schema),

0 commit comments

Comments
 (0)