Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
245e3d2
wip: grdb connection pool
stevensJourney Sep 7, 2025
8428135
wip: grdb
stevensJourney Sep 7, 2025
dbd9c09
Use latest GRDB package. Update tests and queries.
stevensJourney Sep 8, 2025
6f32934
wip: table update hooks
stevensJourney Sep 8, 2025
e2681f6
Add test for GRDB updates triggered by GRDB
stevensJourney Sep 16, 2025
a79ec5c
add join test
stevensJourney Sep 17, 2025
8a278a1
WIP: Add GRDB demo app
stevensJourney Sep 18, 2025
4002d85
demo improvements
stevensJourney Sep 19, 2025
6f0e630
Table updates from PowerSync side
stevensJourney Sep 23, 2025
41174b1
Use SQLite Session API for PowerSync updates.
stevensJourney Sep 25, 2025
7aae6cf
Update GRDB dependency
stevensJourney Sep 25, 2025
e970fd4
Merge remote-tracking branch 'origin/main' into grdb
stevensJourney Sep 25, 2025
76aeb1c
demo update
stevensJourney Sep 25, 2025
281558a
Update README. Cleanup public APIs. WIP WatchOS.
stevensJourney Sep 29, 2025
7beff16
Merge remote-tracking branch 'origin/main' into grdb
stevensJourney Oct 3, 2025
a81986e
Update READMEs
stevensJourney Oct 3, 2025
1c1f2bb
Register extension on WatchOS
stevensJourney Oct 3, 2025
6afa299
Swift Strict Concurrency
stevensJourney Oct 22, 2025
b4d9cbf
Demo and Docs cleanup
stevensJourney Oct 23, 2025
27512a8
Export resolvePowerSyncLoadableExtensionPath from PowerSync SDK.
stevensJourney Nov 4, 2025
fa38d31
delete unused demo tests
stevensJourney Nov 4, 2025
c520836
delete duplicate code block
stevensJourney Nov 4, 2025
6a54ef1
Update README.md
stevensJourney Nov 5, 2025
5efbef4
Update README.md
stevensJourney Nov 6, 2025
4f112b2
Avoid casting in kotlinWithSession
stevensJourney Nov 6, 2025
81074db
Update WatchOS extension loading
stevensJourney Nov 6, 2025
f08484e
Fix withAllConnections issue
stevensJourney Nov 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
730 changes: 730 additions & 0 deletions Demo/GRDB Demo/GRDB Demo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "tinted"
}
],
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions Demo/GRDB Demo/GRDB Demo/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "pslogo.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
14 changes: 14 additions & 0 deletions Demo/GRDB Demo/GRDB Demo/Assets.xcassets/logo.imageset/pslogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions Demo/GRDB Demo/GRDB Demo/Data/List.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import GRDB
import PowerSync

/// PowerSync client side schema
let listsTable = Table(
name: "lists",
columns: [
.text("name"),
.text("owner_id")
]
)

struct List: Codable, Equatable, Identifiable, FetchableRecord, PersistableRecord {
var id: String
var name: String
var ownerId: String

static var databaseTableName = "lists"


enum CodingKeys: String, CodingKey {
case id
case name
case ownerId = "owner_id"
}

enum Columns {
static let id = Column(CodingKeys.id)
static let name = Column(CodingKeys.name)
static let ownerId = Column(CodingKeys.ownerId)
}

static let todos = hasMany(
Todo.self, key: "todos",
using: ForeignKey([Todo.Columns.listId], to: [Columns.id])
)
}

/// Result for displaying lists in the main view
struct ListWithTodoCounts: Decodable, Hashable, Identifiable, FetchableRecord {
var id: String
var name: String
var pendingCount: Int
}
41 changes: 41 additions & 0 deletions Demo/GRDB Demo/GRDB Demo/Data/Todo.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import Foundation
import GRDB
import PowerSync

/// PowerSync client side schema
let todosTable = Table(
name: "todos",
columns: [
.text("description"),
.text("list_id"),
// Conversion should automatically be handled by GRDB
.integer("completed"),
.text("completed_at")
]
)

struct Todo: Codable, Equatable, Identifiable, FetchableRecord, PersistableRecord {
var id: String
var description: String
var listId: String
var isCompleted: Bool
var completedAt: Date?

static var databaseTableName = "todos"

enum CodingKeys: String, CodingKey {
case id
case description
case listId = "list_id"
case isCompleted = "completed"
case completedAt = "completed_at"
}

enum Columns {
static let id = Column(CodingKeys.id)
static let description = Column(CodingKeys.description)
static let listId = Column(CodingKeys.listId)
static let isCompleted = Column(CodingKeys.isCompleted)
static let completedAt = Column(CodingKeys.completedAt)
}
}
Loading
Loading