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
Gallery of example projects/demo apps built with JavaScript Web stacks and PowerSync.
25
22
</Card>
@@ -37,9 +34,9 @@ import JavaScriptWebInstallation from '/snippets/javascript-web/installation.mdx
37
34
38
35
Before implementing the PowerSync SDK in your project, make sure you have completed these steps:
39
36
40
-
* Signed up for a PowerSync Cloud account ([here](https://accounts.journeyapps.com/portal/powersync-signup?s=docs)) or [self-host PowerSync](/self-hosting/getting-started).
41
-
*[Configured your backend database](/installation/database-setup) and connected it to your PowerSync instance.
42
-
*[Installed](/client-sdk-references/javascript-web#installation) the PowerSync Web SDK.
37
+
- Signed up for a PowerSync Cloud account ([here](https://accounts.journeyapps.com/portal/powersync-signup?s=docs)) or [self-host PowerSync](/self-hosting/getting-started).
38
+
-[Configured your backend database](/installation/database-setup) and connected it to your PowerSync instance.
39
+
-[Installed](/client-sdk-references/javascript-web#installation) the PowerSync Web SDK.
43
40
44
41
### 1. Define the Schema
45
42
@@ -55,7 +52,7 @@ This schema represents a "view" of the downloaded data. No migrations are requir
55
52
Similar functionality exists in the [CLI](/usage/tools/cli).
56
53
</Info>
57
54
58
-
The types available are `text`, `integer` and `real`. These should map directly to the values produced by the [Sync Rules](/usage/sync-rules). If a value doesn't match, it is cast automatically. For details on how Postgres types are mapped to the types below, see the section on [Types](/usage/sync-rules/types) in the *Sync Rules* documentation.
55
+
The types available are `text`, `integer` and `real`. These should map directly to the values produced by the [Sync Rules](/usage/sync-rules). If a value doesn't match, it is cast automatically. For details on how Postgres types are mapped to the types below, see the section on [Types](/usage/sync-rules/types) in the _Sync Rules_ documentation.
59
56
60
57
**Example**:
61
58
@@ -110,7 +107,7 @@ Its primary functions are to record all changes in the local database, whether o
Accordingly, the connector must implement two methods:
153
150
154
-
1.[PowerSyncBackendConnector.fetchCredentials](https://github.com/powersync-ja/powersync-js/blob/ed5bb49b5a1dc579050304fab847feb8d09b45c7/packages/common/src/client/connection/PowerSyncBackendConnector.ts#L16) - This is called every couple of minutes and is used to obtain credentials for your app backend API. -> See [Authentication Setup](/installation/authentication-setup) for instructions on how the credentials should be generated.
151
+
1.[PowerSyncBackendConnector.fetchCredentials](https://github.com/powersync-ja/powersync-js/blob/ed5bb49b5a1dc579050304fab847feb8d09b45c7/packages/common/src/client/connection/PowerSyncBackendConnector.ts#L16) - This is called every couple of minutes and is used to obtain credentials for your app backend API. -\> See [Authentication Setup](/installation/authentication-setup) for instructions on how the credentials should be generated.
155
152
2.[PowerSyncBackendConnector.uploadData](https://github.com/powersync-ja/powersync-js/blob/ed5bb49b5a1dc579050304fab847feb8d09b45c7/packages/common/src/client/connection/PowerSyncBackendConnector.ts#L24) - Use this to upload client-side changes to your app backend.
156
-
-> See [Writing Client Changes](/installation/app-backend-setup/writing-client-changes) for considerations on the app backend implementation.
153
+
-\> See [Writing Client Changes](/installation/app-backend-setup/writing-client-changes) for considerations on the app backend implementation.
157
154
158
155
**Example**:
159
156
@@ -189,10 +186,10 @@ Once the PowerSync instance is configured you can start using the SQLite DB func
189
186
190
187
The most commonly used CRUD functions to interact with your SQLite data are:
191
188
192
-
*[PowerSyncDatabase.get](/client-sdk-references/javascript-web#fetching-a-single-item) - get (SELECT) a single row from a table.
193
-
*[PowerSyncDatabase.getAll](/client-sdk-references/javascript-web#querying-items-powersync.getall) - get (SELECT) a set of rows from a table.
194
-
*[PowerSyncDatabase.watch](/client-sdk-references/javascript-web#watching-queries-powersync.watch) - execute a read query every time source tables are modified.
195
-
*[PowerSyncDatabase.execute](/client-sdk-references/javascript-web#mutations-powersync.execute) - execute a write (INSERT/UPDATE/DELETE) query.
189
+
-[PowerSyncDatabase.get](/client-sdk-references/javascript-web#fetching-a-single-item) - get (SELECT) a single row from a table.
190
+
-[PowerSyncDatabase.getAll](/client-sdk-references/javascript-web#querying-items-powersync.getall) - get (SELECT) a set of rows from a table.
191
+
-[PowerSyncDatabase.watch](/client-sdk-references/javascript-web#watching-queries-powersync.watch) - execute a read query every time source tables are modified.
192
+
-[PowerSyncDatabase.execute](/client-sdk-references/javascript-web#mutations-powersync.execute) - execute a write (INSERT/UPDATE/DELETE) query.
@@ -299,7 +297,6 @@ This SDK supports two methods for streaming sync commands:
299
297
- Back-pressure is effectively managed through client-controlled command requests.
300
298
- Sync commands are transmitted efficiently as BSON (binary) documents.
301
299
- This method is **recommended** since it will support the future [BLOB column support](https://roadmap.powersync.com/c/88-support-for-blob-column-types) feature.
302
-
303
300
2.**HTTP Streaming (Legacy)**
304
301
- This is the original implementation method.
305
302
- This method will not support the future BLOB column feature.
0 commit comments