Skip to content

Commit 0c3b5ab

Browse files
cleanup
1 parent aacaf3a commit 0c3b5ab

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

Sources/PowerSync/Kotlin/KotlinPowerSyncDatabaseImpl.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ final class KotlinPowerSyncDatabaseImpl: PowerSyncDatabaseProtocol,
1919
) {
2020
self.logger = logger
2121
self.kotlinDatabase = kotlinDatabase
22-
// We currently use the dbFilename to delete the database files when the database is closed
23-
// The kotlin PowerSyncdatabase.identifier currently prepends `null` to the dbFilename (for the directory).
22+
/// We currently use the dbFilename to delete the database files when the database is closed
23+
/// The kotlin PowerSyncDatabase.identifier currently prepends `null` to the dbFilename (for the directory).
24+
/// FIXME. Update this once we support database directory configuration.
2425
self.dbFilename = dbFilename
2526
currentStatus = KotlinSyncStatus(
2627
baseStatus: kotlinDatabase.currentStatus

Sources/PowerSyncGRDB/Config/Configuration+PowerSync.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public extension Configuration {
2828
) throws {
2929
// Handles the case on WatchOS where the extension is statically loaded.
3030
// We need to register the extension before SQLite connections are established.
31-
// This should only throw on non-WatchOS platforms if the extension path cannot be resolved. So we catch and ignore the error.
31+
// This should only throw on non-WatchOS platforms if the extension path cannot be resolved.
3232
let extensionPath = try resolvePowerSyncLoadableExtensionPath()
3333

3434
// Register the PowerSync core extension

Tests/PowerSyncGRDBTests/BasicTest.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ final class GRDBTests: XCTestCase {
8282
database = openPowerSyncWithGRDB(
8383
pool: pool,
8484
schema: schema,
85-
identifier: "test"
85+
identifier: "test.sqlite"
8686
)
8787

8888
try await database.disconnectAndClear()
@@ -100,11 +100,13 @@ final class GRDBTests: XCTestCase {
100100
// Create users with the PowerSync SDK
101101
let initialUserName = "Bob"
102102

103+
print("creating user \(initialUserName)")
103104
try await database.execute(
104105
sql: "INSERT INTO users(id, name) VALUES(uuid(), ?)",
105106
parameters: [initialUserName]
106107
)
107108

109+
print("fetching users")
108110
// Fetch those users
109111
let initialUserNames = try await database.getAll(
110112
"SELECT * FROM users"
@@ -114,6 +116,7 @@ final class GRDBTests: XCTestCase {
114116

115117
XCTAssertTrue(initialUserNames.first == initialUserName)
116118

119+
print("fetching users with GRDB")
117120
// Now define a GRDB struct for query purposes
118121
// Query the Users with GRDB, this should have the same result as with PowerSync
119122
let grdbUserNames = try await pool.read { database in
@@ -122,6 +125,7 @@ final class GRDBTests: XCTestCase {
122125

123126
XCTAssertTrue(grdbUserNames.first?.name == initialUserName)
124127

128+
print("inserting user with GRDB")
125129
// Insert a user with GRDB
126130
try await pool.write { database in
127131
try User(
@@ -130,6 +134,7 @@ final class GRDBTests: XCTestCase {
130134
).insert(database)
131135
}
132136

137+
print("fetching users with GRDB after insert")
133138
let grdbUserNames2 = try await pool.read { database in
134139
try User.order(User.Columns.name.asc).fetchAll(database)
135140
}

0 commit comments

Comments
 (0)