Skip to content

Commit

Permalink
Simplify Readme since we have most content in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
benitav committed Nov 5, 2024
1 parent 84fc564 commit 72ae64d
Showing 1 changed file with 8 additions and 39 deletions.
47 changes: 8 additions & 39 deletions packages/powersync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ flutter pub add powersync

# Getting Started

Our [full SDK reference](https://docs.powersync.com/client-sdk-references/flutter) contains everything you need to know to get started implementing PowerSync in your project.
Our [full SDK reference](https://docs.powersync.com/client-sdk-references/flutter) contains everything you need to know to get started implementing PowerSync in your project.

## **Web support - Beta**

Web support in version 1.9.0 is currently in a beta release. This means it is safe to use in production, provided that you've tested your use cases.
Web support in version 1.9.0 is currently in a beta release. It is functionally ready for production use, provided that you've tested your use cases.

Please familiarize yourself with the Current Limitations for Web documented [here](https://docs.powersync.com/client-sdk-references/flutter/flutter-web-support#current-limitations).

### Demo app

Expand All @@ -39,53 +41,20 @@ The easiest way to test Flutter Web support is to run the [Supabase Todo-List](h

### Installing PowerSync in your own project

Install the latest version of the package, for example:
Install the [latest version]((https://pub.dev/packages/powersync/versions)) of the package, for example:

```
flutter pub add powersync:'^1.9.0'
```

The latest version can be found [here](https://pub.dev/packages/powersync/versions).

### Additional config
#### Additional config

Web support requires `sqlite3.wasm` and worker (`powersync_db.worker.js` and `powersync_sync.worker.js`) assets to be served from the web application. They can be downloaded to the `web` directory by running the following command in your application's root folder.
Web support requires `sqlite3.wasm` and worker (`powersync_db.worker.js` and `powersync_sync.worker.js`) assets to be served from the web application. They can be downloaded to the web directory by running the following command in your application's root folder.

```dart
```bash
dart run powersync:setup_web
```

The same code is used for initializing native and web `PowerSyncDatabase` clients.

### Limitations

The API for Web is essentially the same as for native platforms, however, some features within `PowerSyncDatabase` clients are not available.

#### Imports

Flutter Web does not support importing directly from `sqlite3.dart` as it uses `dart:ffi`.

Change imports from

```Dart
import 'package/powersync/sqlite3.dart`
```

to

```Dart
import 'package/powersync/sqlite3_common.dart'
```

In code which needs to run on the Web platform. Isolated native specific code can still import from `sqlite3.dart`.

#### Database connections

Web DB connections do not support concurrency. A single DB connection is used. `readLock` and `writeLock` contexts do not
implement checks for preventing writable queries in read connections and vice-versa.

Direct access to the synchronous `CommonDatabase` (`sqlite.Database` equivalent for web) connection is not available. `computeWithDatabase` is not available on web.

# Changelog

A changelog for this SDK is available [here](https://releases.powersync.com/announcements/flutter-client-sdk).
Expand Down

0 comments on commit 72ae64d

Please sign in to comment.