Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 3 additions & 27 deletions client-sdks/orms/kotlin/room.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,32 +99,14 @@ To inform PowerSync about that table, include it as a `RawTable` in the schema:

```Kotlin
val schema = Schema(
// For more information on raw tables, see https://docs.powersync.com/client-sdks/advanced/raw-tables
RawTable(
name = "todos",
put =
PendingStatement(
"INSERT OR REPLACE INTO todos (id, description, created_by) VALUES (?, ?, ?)",
listOf(
PendingStatementParameter.Id,
PendingStatementParameter.Column("description"),
PendingStatementParameter.Column("created_by"),
),
),
delete =
PendingStatement(
"DELETE FROM todos WHERE id = ?",
listOf(PendingStatementParameter.Id),
),
schema = RawTableSchema(),
),
)
```

Here:

- The SQL statements must match the schema created by Room.
- The `RawTable.name` and `PendingStatementParameter.Column` values must match the table and column names of the synced
table from the PowerSync Service, derived from your Sync Rules.

For more details, see [raw tables](/client-sdks/advanced/raw-tables).

After these steps, you can open your Room database like you normally would. Then, you can use the
Expand All @@ -146,13 +128,7 @@ The returned `PowerSyncDatabase` behaves just like a regular PowerSync database,
`connect` to establish a sync connection:

```Kotlin
powersync.connect(
YourBackendConnector(),
options = SyncOptions(
// Raw tables require the new client implementation.
newClientImplementation = true
)
)
powersync.connect(YourBackendConnector())
```

## Usage
Expand Down
9 changes: 6 additions & 3 deletions sync/streams/migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
| Node.js | v0.11.0 | v0.16.0 |
| Capacitor | v0.0.1 | v0.3.0 |
| Tauri | v0.0.1 | Always (Rust client only) |
| Dart/Flutter | v1.16.0 | v1.17.0 |
| Kotlin | v1.7.0 | v1.9.0 |
| Dart/Flutter | v1.16.0 | v1.17.0 (legacy client removed in v2.0.0) |
| Kotlin | v1.7.0 | v1.9.0 (legacy client removed in v1.12.0) |
| Swift | v1.11.0 | v1.8.0 |
| .NET | v0.0.8-alpha.1 | v0.0.5-alpha.1 |
</Tab>
Expand All @@ -79,16 +79,19 @@
);
```

<Note>As of Dart SDK v2.0.0, the legacy sync client has been removed and the Rust client is the only implementation. The `syncImplementation` parameter is no longer needed.</Note>

Check warning on line 82 in sync/streams/migration.mdx

View check run for this annotation

Mintlify / Mintlify Validation (powersync) - vale-spellcheck

sync/streams/migration.mdx#L82

Did you really mean 'syncImplementation'?

**Kotlin:**
```kotlin
database.connect(MyConnector(), options = SyncOptions(
newClientImplementation = true,
))
```
<Note>As of Kotlin SDK v1.12.0, the legacy sync client has been removed and the Rust client is the only implementation. The `newClientImplementation` parameter is no longer needed.</Note>

**Swift:**
```swift
@_spi(PowerSyncExperimental) import PowerSync
import PowerSync

try await db.connect(connector: connector, options: ConnectOptions(
newClientImplementation: true,
Expand Down