Skip to content

Commit f1943d5

Browse files
committed
[powersync] Docs polish
1 parent c08ef93 commit f1943d5

File tree

8 files changed

+86
-15
lines changed

8 files changed

+86
-15
lines changed

releases.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
<p>This is a reverse chronological list of the major <a href="https://tinybase.org/">TinyBase</a> releases, with highlighted features.</p><h2 id="v4-7">v4.7</h2><p>This release includes the new <a href="https://tinybase.org/api/persister-libsql/"><code>persister-libsql</code></a> module, which provides a <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> for <a href="https://turso.tech/libsql">Turso&#x27;s LibSQL</a> database.</p><p>Use the <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> by passing in a reference to the LibSQL client to the createLibSQLPersister function; something like:</p>
1+
<p>This is a reverse chronological list of the major <a href="https://tinybase.org/">TinyBase</a> releases, with highlighted features.</p><h2 id="v4-8">v4.8</h2><p>This release includes the new <a href="https://tinybase.org/api/persister-powersync/"><code>persister-powersync</code></a> module, which provides a <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> for <a href="https://www.powersync.com/">PowerSync&#x27;s SQLite</a> database.</p><p>Much like the other SQLite persisters, use it by passing in a PowerSync instance to the <a href="https://tinybase.org/api/persister-powersync/functions/creation/createpowersyncpersister/"><code>createPowerSyncPersister</code></a> function; something like:</p>
2+
3+
```js yolo
4+
const powerSync = usePowerSync();
5+
6+
const persister = createPowerSyncPersister(store, powerSync, {
7+
mode: 'tabular',
8+
tables: {
9+
load: {items: {tableId: 'items', rowIdColumnName: 'value'}},
10+
save: {items: {tableName: 'items', rowIdColumnName: 'value'}},
11+
},
12+
});
13+
```
14+
15+
<p>A huge thank you to <a href="https://bndkt.com/">Benedikt Mueller</a> (<a href="https://github.com/bndkt">@bndkt</a>) for building out this functionality! And please provide feedback on how this new <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> works for you.</p><h2 id="v4-7">v4.7</h2><p>This release includes the new <a href="https://tinybase.org/api/persister-libsql/"><code>persister-libsql</code></a> module, which provides a <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> for <a href="https://turso.tech/libsql">Turso&#x27;s LibSQL</a> database.</p><p>Use the <a href="https://tinybase.org/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> by passing in a reference to the LibSQL client to the createLibSQLPersister function; something like:</p>
216

317
```js yolo
418
const client = createClient({url: 'file:my.db'});

site/extras/powersync.svg

Lines changed: 25 additions & 0 deletions
Loading

site/guides/03_schemas_and_persistence/4_persisting_data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ databases, and across synchronization boundaries with CRDT frameworks.
2424
| persister-remote | createRemotePersister | Remote server |
2525
| persister-file | createFilePersister | Local file (where possible) |
2626
| persister-partykit-client | createPartyKitPersister | PartyKit with the persister-partykit-server module |
27-
| persister-powersync | createPowerSyncPersister | PowerSync, via [@journeyapps/powersync-sdk-common](https://github.com/powersync-ja/powersync-js) |
2827
| persister-sqlite3 | createSqlite3Persister | SQLite in Node, via [sqlite3](https://github.com/TryGhost/node-sqlite3) |
2928
| persister-sqlite-wasm | createSqliteWasmPersister | SQLite in a browser, via [sqlite-wasm](https://github.com/tomayac/sqlite-wasm) |
3029
| persister-cr-sqlite-wasm | createCrSqliteWasmPersister | SQLite CRDTs, via [cr-sqlite-wasm](https://github.com/vlcn-io/cr-sqlite) |
3130
| persister-expo-sqlite | createExpoSqlitePersister | SQLite in React Native, via [expo-sqlite](https://github.com/expo/expo/tree/main/packages/expo-sqlite) |
3231
| persister-expo-sqlite-next | createExpoSqliteNextPersister | SQLite in React Native, via [expo-sqlite/next](https://github.com/expo/expo/tree/main/packages/expo-sqlite) |
3332
| persister-electric-sql | createElectricSqlPersister | Electric SQL, via [electric](https://github.com/electric-sql/electric) |
3433
| persister-libsql | createLibSqlPersister | LibSQL for Turso, via [libsql-client](https://github.com/tursodatabase/libsql-client-ts) |
34+
| persister-powersync | createPowerSyncPersister | PowerSync, via [powersync-sdk](https://github.com/powersync-ja/powersync-js) |
3535
| persister-yjs | createYjsPersister | Yjs CRDTs, via [yjs](https://github.com/yjs/yjs) |
3636
| persister-automerge | createSqliteWasmPersister | Automerge CRDTs, via [automerge-repo](https://github.com/automerge/automerge-repo) |
3737

site/guides/03_schemas_and_persistence/6_database_persistence.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
Since v4.0, there are various options for persisting Store data to and from
44
SQLite databases, via a range of third-party modules.
55

6-
There are currently five SQLite-based persistence options:
7-
8-
| Module | Function | Storage |
9-
| -------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------ |
10-
| persister-sqlite3 | createSqlite3Persister | SQLite in Node, via [sqlite3](https://github.com/TryGhost/node-sqlite3) |
11-
| persister-sqlite-wasm | createSqliteWasmPersister | SQLite in a browser, via [sqlite-wasm](https://github.com/tomayac/sqlite-wasm) |
12-
| persister-cr-sqlite-wasm | createCrSqliteWasmPersister | SQLite CRDTs, via [cr-sqlite-wasm](https://github.com/vlcn-io/cr-sqlite) |
13-
| persister-expo-sqlite | createExpoSqlitePersister | SQLite in React Native, via [expo-sqlite](https://github.com/expo/expo/tree/main/packages/expo-sqlite) |
14-
| persister-expo-sqlite-next | createExpoNextSqlitePersister | SQLite in React Native, via [expo-sqlite](https://github.com/expo/expo/tree/main/packages/expo-sqlite) |
6+
There are currently eight SQLite-based persistence options:
7+
8+
| Module | Function | Storage |
9+
| -------------------------- | ----------------------------- | ----------------------------------------------------------------------------------------------------------- |
10+
| persister-sqlite3 | createSqlite3Persister | SQLite in Node, via [sqlite3](https://github.com/TryGhost/node-sqlite3) |
11+
| persister-sqlite-wasm | createSqliteWasmPersister | SQLite in a browser, via [sqlite-wasm](https://github.com/tomayac/sqlite-wasm) |
12+
| persister-cr-sqlite-wasm | createCrSqliteWasmPersister | SQLite CRDTs, via [cr-sqlite-wasm](https://github.com/vlcn-io/cr-sqlite) |
13+
| persister-expo-sqlite | createExpoSqlitePersister | SQLite in React Native, via [expo-sqlite](https://github.com/expo/expo/tree/main/packages/expo-sqlite) |
14+
| persister-expo-sqlite-next | createExpoSqliteNextPersister | SQLite in React Native, via [expo-sqlite/next](https://github.com/expo/expo/tree/main/packages/expo-sqlite) |
15+
| persister-electric-sql | createElectricSqlPersister | Electric SQL, via [electric](https://github.com/electric-sql/electric) |
16+
| persister-libsql | createLibSqlPersister | LibSQL for Turso, via [libsql-client](https://github.com/tursodatabase/libsql-client-ts) |
17+
| persister-powersync | createPowerSyncPersister | PowerSync, via [powersync-sdk](https://github.com/powersync-ja/powersync-js) |
1518

1619
(Take a look at the
1720
[vite-tinybase-ts-react-crsqlite](https://github.com/tinyplex/vite-tinybase-ts-react-crsqlite)

site/guides/10_releases.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,30 @@
33
This is a reverse chronological list of the major TinyBase releases, with
44
highlighted features.
55

6+
## v4.8
7+
8+
This release includes the new persister-powersync module, which provides a
9+
Persister for [PowerSync's SQLite](https://www.powersync.com/) database.
10+
11+
Much like the other SQLite persisters, use it by passing in a PowerSync instance
12+
to the createPowerSyncPersister function; something like:
13+
14+
```js yolo
15+
const powerSync = usePowerSync();
16+
17+
const persister = createPowerSyncPersister(store, powerSync, {
18+
mode: 'tabular',
19+
tables: {
20+
load: {items: {tableId: 'items', rowIdColumnName: 'value'}},
21+
save: {items: {tableName: 'items', rowIdColumnName: 'value'}},
22+
},
23+
});
24+
```
25+
26+
A huge thank you to [Benedikt Mueller](https://bndkt.com/)
27+
([@bndkt](https://github.com/bndkt)) for building out this functionality! And
28+
please provide feedback on how this new Persister works for you.
29+
630
## v4.7
731

832
This release includes the new persister-libsql module, which provides a

site/home/index.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
</p>
1313
</section>
1414

15-
<a href='/guides/releases/#v4-7'><em>NEW!</em> v4.7 release</a> <span
16-
id="one-with">"The One With Turso"</span>
15+
<a href='/guides/releases/#v4-8'><em>NEW!</em> v4.8 release</a> <span
16+
id="one-with">"The One With PowerSync"</span>
1717

1818
<a class='start' href='/guides/the-basics/getting-started/'>Get started</a>
1919

@@ -111,6 +111,11 @@ id="one-with">"The One With Turso"</span>
111111
<img width="48" src="/turso.svg" />Turso
112112
</a>
113113
</div>
114+
<div>
115+
<a href='/guides/schemas-and-persistence/database-persistence'>
116+
<img width="48" src="/powersync.svg" />PowerSync
117+
</a>
118+
</div>
114119
<div>
115120
<a href='/api/persister-indexed-db/functions/creation/createindexeddbpersister'>
116121
<img width="48" src="/indexeddb.svg" /> IndexedDB

src/types/docs/persisters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
* |persister-remote|createRemotePersister|Remote server|
1818
* |persister-file|createFilePersister|Local file (where possible)|
1919
* |persister-partykit-client|createPartyKitPersister|PartyKit with the persister-partykit-server module|
20-
* |persister-powersync|createPowerSyncPersister|PowerSync, via [@journeyapps/powersync-sdk-common](https://github.com/powersync-ja/powersync-js)|
2120
* |persister-sqlite3|createSqlite3Persister|SQLite in Node, via [sqlite3](https://github.com/TryGhost/node-sqlite3)|
2221
* |persister-sqlite-wasm|createSqliteWasmPersister|SQLite in a browser, via [sqlite-wasm](https://github.com/tomayac/sqlite-wasm)|
2322
* |persister-cr-sqlite-wasm|createCrSqliteWasmPersister|SQLite CRDTs, via [cr-sqlite-wasm](https://github.com/vlcn-io/cr-sqlite)|
2423
* |persister-expo-sqlite|createExpoSqlitePersister|SQLite in React Native, via [expo-sqlite](https://github.com/expo/expo/tree/main/packages/expo-sqlite)|
2524
* |persister-expo-sqlite-next|createExpoSqliteNextPersister|SQLite in React Native, via [expo-sqlite/next](https://github.com/expo/expo/tree/main/packages/expo-sqlite/next)|
2625
* |persister-electric-sql|createElectricSqlPersister|Electric SQL, via [electric-sql](https://github.com/electric-sql/electric)|
2726
* |persister-libsql|createLibSqlPersister|LibSQL for Turso, via [libsql-client](https://github.com/tursodatabase/libsql-client-ts)|
27+
* |persister-powersync|createPowerSyncPersister|PowerSync, via [powersync-sdk](https://github.com/powersync-ja/powersync-js)|
2828
* |persister-yjs|createYjsPersister|Yjs CRDTs, via [yjs](https://github.com/yjs/yjs)|
2929
* |persister-automerge|createSqliteWasmPersister|Automerge CRDTs, via [automerge-repo](https://github.com/automerge/automerge-repo)|
3030
*

src/types/docs/persisters/persister-powersync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
* ```js yolo
8282
* const ps = usePowerSync();
8383
* const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
84-
* const persister = createExpoSqlitePersister(store, ps, 'my_tinybase');
84+
* const persister = createPowerSyncPersister(store, ps, 'my_tinybase');
8585
*
8686
* await persister.save();
8787
* // Store will be saved to the database.

0 commit comments

Comments
 (0)