Skip to content

Commit 116ae4d

Browse files
authored
Raw tables: Mention Swift support (#201)
1 parent 4d4a440 commit 116ae4d

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

usage/use-case-examples/raw-tables.mdx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Raw tables were introduced in the following versions of our client SDKs:
2424
- __JavaScript__ (Node: `0.8.0`, React-Native: `1.23.0`, Web: `1.24.0`)
2525
- __Dart__: Version 1.15.0 of `package:powersync`.
2626
- __Kotlin__: Version 1.3.0
27+
- __Swift__: Version 1.3.0
2728

2829
Also note that raw tables are only supported by the new [Rust-based sync client](https://releases.powersync.com/announcements/improved-sync-performance-in-our-client-sdks), which is currently opt-in.
2930
</Note>
@@ -175,11 +176,29 @@ val schema = Schema(listOf(
175176
</Tab>
176177

177178
<Tab title="Swift">
178-
Unfortunately, raw tables are not available in the Swift SDK yet.
179+
To define a raw table, include it in the list of tables passed to the `Schema`:
180+
181+
```Swift
182+
let lists = RawTable(
183+
name: "todo_lists",
184+
put: PendingStatement(
185+
sql: "INSERT OR REPLACE INTO todo_lists (id, created_by, title, content) VALUES (?, ?, ?, ?)",
186+
parameters: [.id, .column("created_by"), .column("title"), .column("content")]
187+
),
188+
delete: PendingStatement(
189+
sql: "DELETE FROM todo_lists WHERE id = ?",
190+
parameters: [.id],
191+
),
192+
)
193+
194+
let schema = Schema(lists)
195+
```
179196
</Tab>
180197

181198
<Tab title=".NET">
182199
Unfortunately, raw tables are not available in the .NET SDK yet.
200+
201+
------
183202
</Tab>
184203

185204
</Tabs>

0 commit comments

Comments
 (0)