diff --git a/architecture/client-architecture.mdx b/architecture/client-architecture.mdx index c8316c5b..0cf51c49 100644 --- a/architecture/client-architecture.mdx +++ b/architecture/client-architecture.mdx @@ -30,7 +30,7 @@ The local SQLite database embedded in the PowerSync SDK is automatically kept in #### Writing Data -Client-side data modifications, namely updates, deletes and inserts, are persisted in the embedded SQLite database as well as stored in an upload queue. The upload queue is a blocking [FIFO](https://en.wikipedia.org/wiki/FIFO%5F%28computing%5Fand%5Felectronics%29) queue that gets processed when network connectivity is available. +Client-side data modifications, namely updates, deletes and inserts, are persisted in the embedded SQLite database as well as stored in an upload queue. The upload queue is a blocking [FIFO](https://en.wikipedia.org/wiki/FIFO_%28computing_and_electronics%29) queue that gets processed when network connectivity is available. Each entry in the queue is processed by writing the entry to your existing backend application API, using a function [defined by you](/installation/client-side-setup/integrating-with-your-backend) (the developer). This is to ensure that existing backend business logic is honored when uploading data changes. For more information, see the section on [integrating with your backend](/installation/client-side-setup/integrating-with-your-backend). diff --git a/client-sdk-references/flutter.mdx b/client-sdk-references/flutter.mdx index 0a6f72cb..2755128c 100644 --- a/client-sdk-references/flutter.mdx +++ b/client-sdk-references/flutter.mdx @@ -191,7 +191,7 @@ The most commonly used CRUD functions to interact with your SQLite data are: ### Fetching a Single Item -The [get](https://pub.dev/documentation/powersync/latest/sqlite%5Fasync/SqliteQueries/get.html) method executes a read-only (SELECT) query and returns a single result. It throws an exception if no result is found. Use [getOptional](https://pub.dev/documentation/powersync/latest/sqlite%5Fasync/SqliteQueries/getOptional.html) to return a single optional result (returns `null` if no result is found). +The [get](https://pub.dev/documentation/powersync/latest/sqlite_async/SqliteQueries/get.html) method executes a read-only (SELECT) query and returns a single result. It throws an exception if no result is found. Use [getOptional](https://pub.dev/documentation/powersync/latest/sqlite_async/SqliteQueries/getOptional.html) to return a single optional result (returns `null` if no result is found). ```dart // Find a list item by ID @@ -203,7 +203,7 @@ Future find(id) async { ### Querying Items (PowerSync.getAll) -The [getAll](https://pub.dev/documentation/powersync/latest/sqlite%5Fasync/SqliteQueries/getAll.html) method returns a set of rows from a table. +The [getAll](https://pub.dev/documentation/powersync/latest/sqlite_async/SqliteQueries/getAll.html) method returns a set of rows from a table. ```dart /// Get all list IDs @@ -215,7 +215,7 @@ Future> getLists() async { ``` ### Watching Queries (PowerSync.watch) -The [watch](https://pub.dev/documentation/powersync/latest/sqlite%5Fasync/SqliteQueries/watch.html) method executes a read query whenever a change to a dependent table is made. +The [watch](https://pub.dev/documentation/powersync/latest/sqlite_async/SqliteQueries/watch.html) method executes a read query whenever a change to a dependent table is made. ```dart StreamBuilder( diff --git a/client-sdk-references/flutter/flutter-orm-support.mdx b/client-sdk-references/flutter/flutter-orm-support.mdx index 8eae0d24..ab799513 100644 --- a/client-sdk-references/flutter/flutter-orm-support.mdx +++ b/client-sdk-references/flutter/flutter-orm-support.mdx @@ -10,7 +10,7 @@ ORM support is available via the following package (currently in an alpha releas diff --git a/client-sdk-references/flutter/usage-examples.mdx b/client-sdk-references/flutter/usage-examples.mdx index 71a978b2..334b76b3 100644 --- a/client-sdk-references/flutter/usage-examples.mdx +++ b/client-sdk-references/flutter/usage-examples.mdx @@ -7,7 +7,7 @@ description: "Code snippets and guidelines for common scenarios" Read and write transactions present a context where multiple changes can be made then finally committed to the DB or rolled back. This ensures that either all the changes get persisted, or no change is made to the DB (in the case of a rollback or exception). -The [writeTransaction(callback)](https://pub.dev/documentation/powersync/latest/sqlite%5Fasync/SqliteQueries/writeTransaction.html) method combines all writes into a single transaction, only committing to persistent storage once. +The [writeTransaction(callback)](https://pub.dev/documentation/powersync/latest/sqlite_async/SqliteQueries/writeTransaction.html) method combines all writes into a single transaction, only committing to persistent storage once. ```dart deleteList(SqliteDatabase db, String id) async { @@ -20,11 +20,11 @@ deleteList(SqliteDatabase db, String id) async { } ``` -Also see [readTransaction(callback)](https://pub.dev/documentation/powersync/latest/sqlite%5Fasync/SqliteQueries/readTransaction.html) . +Also see [readTransaction(callback)](https://pub.dev/documentation/powersync/latest/sqlite_async/SqliteQueries/readTransaction.html) . ## Subscribe to changes in data -Use [watch](https://pub.dev/documentation/powersync/latest/sqlite%5Fasync/SqliteQueries/watch.html) to watch for changes to the dependent tables of any SQL query. +Use [watch](https://pub.dev/documentation/powersync/latest/sqlite_async/SqliteQueries/watch.html) to watch for changes to the dependent tables of any SQL query. ```dart StreamBuilder( diff --git a/installation/authentication-setup/firebase-auth.mdx b/installation/authentication-setup/firebase-auth.mdx index eb9f9b5f..d663440f 100644 --- a/installation/authentication-setup/firebase-auth.mdx +++ b/installation/authentication-setup/firebase-auth.mdx @@ -5,7 +5,7 @@ mode: wide Configure authentication on the PowerSync instance with the following settings: -* JWKS URI: [https://www.googleapis.com/service\_accounts/v1/jwk/securetoken@system.gserviceaccount.com](https://www.googleapis.com/service%5Faccounts/v1/jwk/securetoken@system.gserviceaccount.com) +* JWKS URI: [https://www.googleapis.com/service\_accounts/v1/jwk/securetoken@system.gserviceaccount.com](https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com) * JWT Audience: Firebase project ID Firebase signs these tokens using RS256. diff --git a/installation/authentication-setup/supabase-auth/stytch-+-supabase.mdx b/installation/authentication-setup/supabase-auth/stytch-+-supabase.mdx index 3062606b..8913ee0a 100644 --- a/installation/authentication-setup/supabase-auth/stytch-+-supabase.mdx +++ b/installation/authentication-setup/supabase-auth/stytch-+-supabase.mdx @@ -5,7 +5,7 @@ description: "PowerSync is compatible with both Consumer and B2B SaaS Stytch pro ## Consumer Authentication -See this community project for detailed setup instructions: [https://github.com/guillempuche/localfirst\_react\_server](https://github.com/guillempuche/localfirst%5Freact%5Fserver) +See this community project for detailed setup instructions: [https://github.com/guillempuche/localfirst\_react\_server](https://github.com/guillempuche/localfirst_react_server) ## B2B SaaS Authentication diff --git a/installation/database-connection.mdx b/installation/database-connection.mdx index cde168ce..7cc2b922 100644 --- a/installation/database-connection.mdx +++ b/installation/database-connection.mdx @@ -30,7 +30,7 @@ Select your Postgres hosting provider for steps to connect your Postgres databas ``` -1. [Locate the connection details from RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER%5FConnectToPostgreSQLInstance.html): +1. [Locate the connection details from RDS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToPostgreSQLInstance.html): * Copy the **"Endpoint"** value. * Paste the endpoint into the "**Host**" field. * Complete the remaining fields: "**Name**", "**Host**", "**Port**", "**Database name**", "**Username**", "**Password**" and "**SSL Mode"** are required. You can paste a connection string into the "**URI**" field to simplify this. diff --git a/integration-guides/flutterflow-+-powersync.mdx b/integration-guides/flutterflow-+-powersync.mdx index 29784a56..edbff784 100644 --- a/integration-guides/flutterflow-+-powersync.mdx +++ b/integration-guides/flutterflow-+-powersync.mdx @@ -163,7 +163,7 @@ For once, a blank screen means success: 1. Click on **"Custom Code" -> "Add" -> "Action".** 2. Name the Custom Action `initpowersync`. 1. **NOTE:** use all lowercase for this Custom Action is important due to naming conversion that FF performs behind the scenes. -3. Copy and paste the custom action code from here:[https://github.com/powersync-ja/powersync-flutterflow-template/blob/flutterflow/lib/custom\_code/actions/initpowersync.dart](https://github.com/powersync-ja/powersync-flutterflow-template/blob/flutterflow/lib/custom%5Fcode/actions/initpowersync.dart) +3. Copy and paste the custom action code from here:[https://github.com/powersync-ja/powersync-flutterflow-template/blob/flutterflow/lib/custom\_code/actions/initpowersync.dart](https://github.com/powersync-ja/powersync-flutterflow-template/blob/flutterflow/lib/custom_code/actions/initpowersync.dart) 4. Import your schema: 1. On the PowerSync Dashboard, right-click on your instance and select **"Generate Client-Side Schema"** and select Dart as the language. diff --git a/integration-guides/railway-+-powersync.mdx b/integration-guides/railway-+-powersync.mdx index 907b31de..eaef1e90 100644 --- a/integration-guides/railway-+-powersync.mdx +++ b/integration-guides/railway-+-powersync.mdx @@ -14,7 +14,7 @@ Find the PowerSync template on the Railway Marketplace, or click below: diff --git a/integration-guides/supabase-+-powersync/handling-attachments.mdx b/integration-guides/supabase-+-powersync/handling-attachments.mdx index 18988510..3779566e 100644 --- a/integration-guides/supabase-+-powersync/handling-attachments.mdx +++ b/integration-guides/supabase-+-powersync/handling-attachments.mdx @@ -107,7 +107,7 @@ The following improvements can be considered for this implementation. ## Flutter Example -Our Flutter [To-Do List example app](https://github.com/powersync-ja/powersync.dart/tree/master/demos/supabase-todolist) showcases how to sync attachments (such as photos) using our [powersync\_attachments\_helper](https://pub.dev/packages/powersync%5Fattachments%5Fhelper) package for Flutter. +Our Flutter [To-Do List example app](https://github.com/powersync-ja/powersync.dart/tree/master/demos/supabase-todolist) showcases how to sync attachments (such as photos) using our [powersync\_attachments\_helper](https://pub.dev/packages/powersync_attachments_helper) package for Flutter. ## See Also diff --git a/integration-guides/supabase-+-powersync/realtime-streaming.mdx b/integration-guides/supabase-+-powersync/realtime-streaming.mdx index b31c977d..7c14ea2d 100644 --- a/integration-guides/supabase-+-powersync/realtime-streaming.mdx +++ b/integration-guides/supabase-+-powersync/realtime-streaming.mdx @@ -16,4 +16,4 @@ When the SDK is offline, the streaming stops, but automatically resumes when con Example implementations of `watch()` can be found below * [React Native example](https://github.com/powersync-ja/powersync-js/blob/92384f75ec95c64ee843e2bb7635a16ca4142945/demos/django-react-native-todolist/library/stores/ListStore.ts#L5) -* [Flutter example](https://github.com/powersync-ja/powersync.dart/blob/master/demos/supabase-todolist/lib/models/todo%5Flist.dart#L46) +* [Flutter example](https://github.com/powersync-ja/powersync.dart/blob/master/demos/supabase-todolist/lib/models/todo_list.dart#L46) diff --git a/resources/demo-apps-example-projects.mdx b/resources/demo-apps-example-projects.mdx index fe4205ae..d395c424 100644 --- a/resources/demo-apps-example-projects.mdx +++ b/resources/demo-apps-example-projects.mdx @@ -110,7 +110,7 @@ For example implementations and details of common use cases, see [Use Case Examp ### JavaScript & TypeScript * Effect + Kysely + Stytch - * [https://github.com/guillempuche/localfirst\_react\_server](https://github.com/guillempuche/localfirst%5Freact%5Fserver) + * [https://github.com/guillempuche/localfirst\_react\_server](https://github.com/guillempuche/localfirst_react_server) * Tauri + Shadcn UI * [https://github.com/romatallinn/powersync-tauri](https://github.com/romatallinn/powersync-tauri) * Expo Web diff --git a/self-hosting/installation/client-side-setup.mdx b/self-hosting/installation/client-side-setup.mdx index fa98c08d..cf12eaff 100644 --- a/self-hosting/installation/client-side-setup.mdx +++ b/self-hosting/installation/client-side-setup.mdx @@ -123,7 +123,7 @@ For more details, see [Supabase Auth](/installation/authentication-setup/supabas Under `client_auth` in your config file, add your Firebase JWKS URI and audience. -* JWKS URI: [https://www.googleapis.com/service\_accounts/v1/jwk/securetoken@system.gserviceaccount.com](https://www.googleapis.com/service%5Faccounts/v1/jwk/securetoken@system.gserviceaccount.com) +* JWKS URI: [https://www.googleapis.com/service\_accounts/v1/jwk/securetoken@system.gserviceaccount.com](https://www.googleapis.com/service_accounts/v1/jwk/securetoken@system.gserviceaccount.com) * JWT Audience: Your Firebase project ID diff --git a/usage/lifecycle-maintenance/compacting-buckets.mdx b/usage/lifecycle-maintenance/compacting-buckets.mdx index c859a829..24c1bac7 100644 --- a/usage/lifecycle-maintenance/compacting-buckets.mdx +++ b/usage/lifecycle-maintenance/compacting-buckets.mdx @@ -125,7 +125,7 @@ One approach is to have regular partial defragmentation, using a query such as: UPDATE lists SET updated_at = now() WHERE updated_at < now() - interval '1 week' ``` -This can be performed on a regular schedule such as every hour or every day, using [pg\_cron](https://github.com/citusdata/pg%5Fcron) or backend-level scheduled tasks. +This can be performed on a regular schedule such as every hour or every day, using [pg\_cron](https://github.com/citusdata/pg_cron) or backend-level scheduled tasks. The above example will cause clients to re-sync each row once a week, while preventing the number of operations from growing indefinitely. Depending on how often rows in the bucket are modified, the interval can be increased or decreased. diff --git a/usage/lifecycle-maintenance/implementing-schema-changes.mdx b/usage/lifecycle-maintenance/implementing-schema-changes.mdx index 6b67a3b3..6c924826 100644 --- a/usage/lifecycle-maintenance/implementing-schema-changes.mdx +++ b/usage/lifecycle-maintenance/implementing-schema-changes.mdx @@ -34,7 +34,7 @@ The schema as supplied on the client is only a view on top of the schemaless dat 3. Casting between types should never error, but it may not fully represent the original data. For example, casting an arbitrary string to `INTEGER` will likely result in a "0" value. - 4. Full rules for casting between types are described [in the SQLite documentation here](https://www.sqlite.org/lang%5Fexpr.html#castexpr). + 4. Full rules for casting between types are described [in the SQLite documentation here](https://www.sqlite.org/lang_expr.html#castexpr). 4. Removing a table/collection is handled on the client as if the table exists with no data. diff --git a/usage/use-case-examples/attachments-files.mdx b/usage/use-case-examples/attachments-files.mdx index acb305ac..d9c5f9f6 100644 --- a/usage/use-case-examples/attachments-files.mdx +++ b/usage/use-case-examples/attachments-files.mdx @@ -15,7 +15,7 @@ We currently have these helper packages available to manage attachments: | SDK | Attachments Helper Package | Example Implementation | | ----------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | | **React Native / JavaScript** | [powersync-attachments](https://www.npmjs.com/package/@powersync/attachments) | [To-Do List example app](https://github.com/powersync-ja/powersync-js/tree/main/demos/react-native-supabase-todolist) | -| **Flutter** | [powersync\_attachments\_helper](https://pub.dev/packages/powersync%5Fattachments%5Fhelper) | [To-Do List example app](https://github.com/powersync-ja/powersync.dart/tree/master/demos/supabase-todolist) | +| **Flutter** | [powersync\_attachments\_helper](https://pub.dev/packages/powersync_attachments_helper) | [To-Do List example app](https://github.com/powersync-ja/powersync.dart/tree/master/demos/supabase-todolist) | The example implementations above use [Supabase Storage](https://supabase.com/docs/guides/storage) as storage provider. For more information on the use of Supabase as storage provider, refer to: diff --git a/usage/use-case-examples/crdts.mdx b/usage/use-case-examples/crdts.mdx index ed610c40..7259e86d 100644 --- a/usage/use-case-examples/crdts.mdx +++ b/usage/use-case-examples/crdts.mdx @@ -1,6 +1,6 @@ --- title: "CRDTs" -description: "While PowerSync does not use [CRDTs](https://en.wikipedia.org/wiki/Conflict-free%5Freplicated%5Fdata%5Ftype) directly as part of its sync or conflict resolution process, CRDT data (from a library such as [Yjs](https://github.com/yjs/yjs) or y-crdt) may be persisted and synced using PowerSync." +description: "While PowerSync does not use [CRDTs](https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type) directly as part of its sync or conflict resolution process, CRDT data (from a library such as [Yjs](https://github.com/yjs/yjs) or y-crdt) may be persisted and synced using PowerSync." --- This may be useful for cases such as document editing, where last-write-wins is not sufficient for conflict resolution. PowerSync becomes the provider for CRDT data — both for local storage and for propagating changes to other clients. diff --git a/usage/use-case-examples/full-text-search.mdx b/usage/use-case-examples/full-text-search.mdx index 3d8e111e..f5c48bae 100644 --- a/usage/use-case-examples/full-text-search.mdx +++ b/usage/use-case-examples/full-text-search.mdx @@ -12,7 +12,7 @@ This requires creating a separate FTS5 table(s) to index the data, and updating Currently, FTS is supported in: * **Flutter:** [powersync.dart](https://github.com/powersync-ja/powersync.dart) ([PowerSync Flutter SDK](/client-sdk-references/flutter)) - * Relies on the [sqlite\_async](https://pub.dev/documentation/sqlite%5Fasync/latest/) package for migrations + * Relies on the [sqlite\_async](https://pub.dev/documentation/sqlite_async/latest/) package for migrations * **Web:** [powersync-sdk-web](https://github.com/powersync-ja/powersync-js/blob/main/packages/web/README.md) ([JavaScript Web SDK](/client-sdk-references/javascript-web)) * Requires version 0.5.0 or greater of the SDK (incl. version 0.2.0 of the [wa-sqlite](https://github.com/powersync-ja/wa-sqlite) package) @@ -48,7 +48,7 @@ Future openDatabase() async { } ``` -Note: The Web implementation does not use migrations. It creates the FTS tables separately in [utils/fts\_setup.ts](https://github.com/powersync-ja/powersync-js/blob/main/demos/react-supabase-todolist/src/app/utils/fts%5Fsetup.ts). +Note: The Web implementation does not use migrations. It creates the FTS tables separately in [utils/fts\_setup.ts](https://github.com/powersync-ja/powersync-js/blob/main/demos/react-supabase-todolist/src/app/utils/fts_setup.ts). **TypeScript example:** @@ -66,9 +66,9 @@ SystemProvider = ({ children }: { children: React.ReactNode }) => { First, we need to set up the FTS tables to match the `lists` and `todos` tables already created in this demo app. Don't worry if you already have data in the tables, as it will be copied into the new FTS tables. -To simplify implementation these examples make use of SQLite migrations. The migrations are run in [migrations/fts\_setup.dart](https://github.com/powersync-ja/powersync.dart/blob/master/demos/supabase-todolist/lib/migrations/fts%5Fsetup.dart) in the Flutter implementation. Here we use the [sqlite\_async](https://pub.dev/documentation/sqlite%5Fasync/latest/) Dart package to generate the migrations. +To simplify implementation these examples make use of SQLite migrations. The migrations are run in [migrations/fts\_setup.dart](https://github.com/powersync-ja/powersync.dart/blob/master/demos/supabase-todolist/lib/migrations/fts_setup.dart) in the Flutter implementation. Here we use the [sqlite\_async](https://pub.dev/documentation/sqlite_async/latest/) Dart package to generate the migrations. -The FTS tables are created in [utils/fts\_setup.ts](https://github.com/powersync-ja/powersync-js/blob/main/demos/react-supabase-todolist/src/app/utils/fts%5Fsetup.ts) in the Web implementation. +The FTS tables are created in [utils/fts\_setup.ts](https://github.com/powersync-ja/powersync-js/blob/main/demos/react-supabase-todolist/src/app/utils/fts_setup.ts) in the Web implementation. **Dart example:** @@ -181,11 +181,11 @@ Clicking on the search icon will open a search bar which will allow you to searc -It uses a custom search delegate widget found in [widgets/fts\_search\_delegate.dart](https://github.com/powersync-ja/powersync.dart/blob/master/demos/supabase-todolist/lib/widgets/fts%5Fsearch%5Fdelegate.dart) (Flutter) and [widgets/SearchBarWidget.tsx](https://github.com/powersync-ja/powersync-js/blob/main/demos/react-supabase-todolist/src/components/widgets/SearchBarWidget.tsx) (Web) to display the search results. +It uses a custom search delegate widget found in [widgets/fts\_search\_delegate.dart](https://github.com/powersync-ja/powersync.dart/blob/master/demos/supabase-todolist/lib/widgets/fts_search_delegate.dart) (Flutter) and [widgets/SearchBarWidget.tsx](https://github.com/powersync-ja/powersync-js/blob/main/demos/react-supabase-todolist/src/components/widgets/SearchBarWidget.tsx) (Web) to display the search results. ### FTS Helper -We added a helper in [lib/fts\_helpers.dart](https://github.com/powersync-ja/powersync.dart/blob/master/demos/supabase-todolist/lib/fts%5Fhelpers.dart) (Flutter) and [utils/fts\_helpers](https://github.com/powersync-ja/powersync-js/blob/main/demos/react-supabase-todolist/src/app/utils/fts%5Fhelpers.ts)[.ts](https://github.com/powersync-ja/powersync-js/blob/main/demos/react-supabase-todolist/src/app/utils/fts%5Fhelpers.ts) (Web) that allows you to add additional search functionality which can be found in the [SQLite FTS5 extension](https://www.sqlite.org/fts5.html) documentation. +We added a helper in [lib/fts\_helpers.dart](https://github.com/powersync-ja/powersync.dart/blob/master/demos/supabase-todolist/lib/fts_helpers.dart) (Flutter) and [utils/fts\_helpers](https://github.com/powersync-ja/powersync-js/blob/main/demos/react-supabase-todolist/src/app/utils/fts_helpers.ts)[.ts](https://github.com/powersync-ja/powersync-js/blob/main/demos/react-supabase-todolist/src/app/utils/fts_helpers.ts) (Web) that allows you to add additional search functionality which can be found in the [SQLite FTS5 extension](https://www.sqlite.org/fts5.html) documentation. **Dart example:** diff --git a/usage/use-case-examples/infinite-scrolling.mdx b/usage/use-case-examples/infinite-scrolling.mdx index 64e44c42..146843a4 100644 --- a/usage/use-case-examples/infinite-scrolling.mdx +++ b/usage/use-case-examples/infinite-scrolling.mdx @@ -3,7 +3,7 @@ title: "Infinite Scrolling" description: "Infinite scrolling is a software design technique that loads content continuously as the user scrolls down the page/screen." --- -There are a few ways to accomplish infinite scrolling with PowerSync, either by querying data from the local SQLite database, or by [lazy-loading](https://en.wikipedia.org/wiki/Lazy%5Floading) or lazy-syncing data from your backend. +There are a few ways to accomplish infinite scrolling with PowerSync, either by querying data from the local SQLite database, or by [lazy-loading](https://en.wikipedia.org/wiki/Lazy_loading) or lazy-syncing data from your backend. Here is an overview of the different options with pros and cons: