Skip to content

Commit f3e9210

Browse files
Added logger to readme
1 parent 7e9325b commit f3e9210

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<a href="https://www.powersync.com" target="_blank"><img src="https://github.com/powersync-ja/.github/assets/7372448/d2538c43-c1a0-4c47-9a76-41462dba484f"/></a>
33
</p>
44

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.*
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._
66

77
# PowerSync Swift
88

@@ -16,7 +16,7 @@ This SDK is currently in a beta release it is suitable for production use, given
1616

1717
- [Sources](./Sources/)
1818

19-
- This is the Swift SDK implementation.
19+
- This is the Swift SDK implementation.
2020

2121
## Demo Apps / Example Projects
2222

@@ -51,11 +51,35 @@ to your `Package.swift` file and pin the dependency to a specific version. The v
5151

5252
to your `Package.swift` file and pin the dependency to a specific version. This is required because the package is in beta.
5353

54+
## Usage
55+
56+
Create a PowerSync client
57+
58+
```swift
59+
import PowerSync
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+
5479
## Underlying Kotlin Dependency
5580

5681
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).
5782

58-
5983
## Migration from Alpha to Beta
6084

6185
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

Comments
 (0)