You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[PowerSync](https://www.powersync.com) is a sync engine for building local-first apps with instantly-responsive UI/UX and simplified state transfer. Syncs between SQLite on the client-side and Postgres, MongoDB or MySQL on the server-side.*
5
+
_[PowerSync](https://www.powersync.com) is a sync engine for building local-first apps with instantly-responsive UI/UX and simplified state transfer. Syncs between SQLite on the client-side and Postgres, MongoDB or MySQL on the server-side._
6
6
7
7
# PowerSync Swift
8
8
@@ -16,7 +16,7 @@ This SDK is currently in a beta release it is suitable for production use, given
16
16
17
17
-[Sources](./Sources/)
18
18
19
-
- This is the Swift SDK implementation.
19
+
- This is the Swift SDK implementation.
20
20
21
21
## Demo Apps / Example Projects
22
22
@@ -51,11 +51,35 @@ to your `Package.swift` file and pin the dependency to a specific version. The v
51
51
52
52
to your `Package.swift` file and pin the dependency to a specific version. This is required because the package is in beta.
53
53
54
+
## Usage
55
+
56
+
Create a PowerSync client
57
+
58
+
```swift
59
+
importPowerSync
60
+
61
+
let powersync =PowerSyncDatabase(
62
+
schema: Schema(
63
+
tables: [
64
+
Table(
65
+
name: "users",
66
+
columns: [
67
+
.text("count"),
68
+
.integer("is_active"),
69
+
.real("weight"),
70
+
.text("description")
71
+
]
72
+
)
73
+
]
74
+
),
75
+
logger: DefaultLogger(minSeverity: .debug)
76
+
)
77
+
```
78
+
54
79
## Underlying Kotlin Dependency
55
80
56
81
The PowerSync Swift SDK currently makes use of the [PowerSync Kotlin Multiplatform SDK](https://github.com/powersync-ja/powersync-kotlin) with the API tool [SKIE](https://skie.touchlab.co/) and KMMBridge under the hood to help generate and publish a native Swift package. We will move to an entirely Swift native API in v1 and do not expect there to be any breaking changes. For more details, see the [Swift SDK reference](https://docs.powersync.com/client-sdk-references/swift).
57
82
58
-
59
83
## Migration from Alpha to Beta
60
84
61
85
See these [developer notes](https://docs.powersync.com/client-sdk-references/swift#migrating-from-the-alpha-to-the-beta-sdk) if you are migrating from the alpha to the beta version of the Swift SDK.
0 commit comments