File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55* ` PowerSyncDatabase(dbFilename:) ` now accepts an absolute path (starting with ` / ` ), used
66 as-is so the database can live in an App Group container shared with app extensions.
7- Plain filenames keep the existing behavior, and ` close(deleteDatabase: true) ` deletes the
8- files at the absolute location.
9- * Opening the connection pool retries while another process holds the database. The
10- ` pragma journal_mode = WAL ` transition reports ` SQLITE_BUSY ` /` SQLITE_BUSY_RECOVERY `
11- without consulting the busy handler, so concurrent cold opens (an app launching while its
12- extension opens the same file) used to fail; the pool now retries with backoff.
13- * Added an opt-in cross-process change signal: each pool posts a Darwin notification after
14- every committed write and, on receipt, re-emits ` tableUpdates ` with
15- ` EXTERNAL_CHANGES_MARKER ` so ` watch ` queries and the upload client wake for writes made by
16- other processes sharing the database file. Only databases opened from an absolute path
17- (an App Group container) use the signal; in-memory and default-directory databases skip
18- it, since they can't be shared across processes.
7+ Plain filenames keep the existing behavior. The SDK coordinates opening the database to
8+ avoid conflicts and can share update notifications across the main app and extensions.
199
2010## 1.14.3
2111
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ final class CrossProcessChangeSignal: @unchecked Sendable {
2424 init ( databasePath: String , logger: any LoggerProtocol ) {
2525 // Stable across processes: both sides derive the name from the canonical path.
2626 let canonical = URL ( fileURLWithPath: databasePath) . standardizedFileURL. path
27- self . name = " co .powersync.changes.\( Self . fnv1a ( canonical) ) "
27+ self . name = " com .powersync.changes.\( Self . fnv1a ( canonical) ) "
2828 self . logger = logger
2929 }
3030
Original file line number Diff line number Diff line change @@ -9,7 +9,10 @@ public let DEFAULT_DB_FILENAME = "powersync.db"
99/// - dbFilename: The database filename. Defaults to "powersync.db". Plain names are
1010/// stored in the default databases directory; an absolute path (starting with "/") is
1111/// used as-is, which allows sharing the database with app extensions through an App
12- /// Group container.
12+ /// Group container. The database itself can be used concurrently from the main app and
13+ /// its extensions, but only the main app should call `connect`. Two sync connections on
14+ /// the same database waste resources and are untested (and could corrupt the sync
15+ /// client); let extensions read and write, and leave syncing to the app.
1316/// - logger: Optional logging interface
1417/// - initialStatements: An optional list of statements to run as the database is opened.
1518/// - Returns: A configured PowerSyncDatabase instance
You can’t perform that action at this time.
0 commit comments