Skip to content

Commit

Permalink
Merge branch 'main' into feat/crud-transactions-warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mugikhan committed Oct 1, 2024
2 parents 29c7431 + 70b487e commit 8f74f9c
Show file tree
Hide file tree
Showing 22 changed files with 85 additions and 55 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,32 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2024-09-30

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`powersync` - `v1.8.3`](#powersync---v183)
- [`powersync_attachments_helper` - `v0.6.7`](#powersync_attachments_helper---v067)

---

#### `powersync` - `v1.8.3`

- **FIX**: Pass maxReaders parameter to `PowerSyncDatabase.withFactory()`

#### `powersync_attachments_helper` - `v0.6.7`

- Update a dependency to the latest release.


## 2024-09-13

### Changes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<a href="https://www.powersync.com" target="_blank"><img src="https://github.com/powersync-ja/.github/assets/7372448/d2538c43-c1a0-4c47-9a76-41462dba484f"/></a>
</p>

*[PowerSync](https://www.powersync.com) is a Postgres-SQLite sync engine, which helps developers to create local-first real-time reactive apps that work seamlessly both online and offline.*
*[PowerSync](https://www.powersync.com) is a sync engine for building local-first apps with instantly-responsive UI/UX and simplified state transfer. Syncs between SQLite on the client-side and Postgres or MongoDB on the server-side (MySQL coming soon).*

PowerSync SDK for Dart and Flutter
===========
Expand Down
3 changes: 0 additions & 3 deletions demos/django-todolist/lib/api_client.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import 'dart:convert';
import 'package:http/http.dart' as http;
import 'package:logging/logging.dart';

final log = Logger('powersync-django-todolist');

class ApiClient {
final String baseUrl;
Expand Down
5 changes: 3 additions & 2 deletions demos/django-todolist/lib/powersync.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import './app_config.dart';
import './models/schema.dart';

final log = Logger('powersync-django');
final prefs = SharedPreferencesAsync();

/// Postgres Response codes that we cannot recover from by retrying.
final List<RegExp> fatalResponseCodes = [
Expand Down Expand Up @@ -89,8 +90,7 @@ bool _dbInitialized = false;

/// id of the user currently logged in
Future<String?> getUserId() async {
final prefs = await SharedPreferences.getInstance();
return prefs.getString('id');
return await prefs.getString('id');
}

Future<bool> isLoggedIn() async {
Expand Down Expand Up @@ -129,5 +129,6 @@ Future<void> openDatabase() async {

/// Explicit sign out - clear database and log out.
Future<void> logout() async {
await prefs.remove('id');
await db.disconnectAndClear();
}
2 changes: 0 additions & 2 deletions demos/django-todolist/lib/widgets/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:powersync_django_todolist_demo/api_client.dart';
import 'package:powersync_django_todolist_demo/app_config.dart';
import 'package:powersync_django_todolist_demo/powersync.dart';
import 'package:shared_preferences/shared_preferences.dart';

import '../main.dart';

Expand Down Expand Up @@ -42,7 +41,6 @@ class _LoginPageState extends State<LoginPage> {

final payload = _parseJwt(session['access_token']);
if (payload.containsKey('sub')) {
final prefs = await SharedPreferences.getInstance();
await prefs.setString('id', payload['sub'].toString());

//re-init PowerSync manually for first time sign in
Expand Down
2 changes: 1 addition & 1 deletion demos/django-todolist/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
powersync: ^1.8.2
powersync: ^1.8.3
path_provider: ^2.1.1
path: ^1.8.3
logging: ^1.2.0
Expand Down
2 changes: 1 addition & 1 deletion demos/supabase-anonymous-auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter

powersync: ^1.8.2
powersync: ^1.8.3
path_provider: ^2.1.1
supabase_flutter: ^2.0.2
path: ^1.8.3
Expand Down
2 changes: 1 addition & 1 deletion demos/supabase-edge-function-auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
flutter:
sdk: flutter

powersync: ^1.8.2
powersync: ^1.8.3
path_provider: ^2.1.1
supabase_flutter: ^2.0.2
path: ^1.8.3
Expand Down
2 changes: 1 addition & 1 deletion demos/supabase-simple-chat/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ dependencies:

supabase_flutter: ^2.0.2
timeago: ^3.6.0
powersync: ^1.8.2
powersync: ^1.8.3
path_provider: ^2.1.1
path: ^1.8.3
logging: ^1.2.0
Expand Down
4 changes: 2 additions & 2 deletions demos/supabase-todolist-drift/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ environment:
dependencies:
flutter:
sdk: flutter
powersync_attachments_helper: ^0.6.6
powersync: ^1.8.2
powersync_attachments_helper: ^0.6.7
powersync: ^1.8.3
path_provider: ^2.1.1
supabase_flutter: ^2.0.1
path: ^1.8.3
Expand Down
2 changes: 1 addition & 1 deletion demos/supabase-todolist-optional-sync/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
powersync: ^1.8.2
powersync: ^1.8.3
path_provider: ^2.1.1
supabase_flutter: ^2.0.1
path: ^1.8.3
Expand Down
30 changes: 15 additions & 15 deletions demos/supabase-todolist/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
PODS:
- app_links (0.0.1):
- app_links (0.0.2):
- Flutter
- camera_avfoundation (0.0.1):
- Flutter
- Flutter (1.0.0)
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- powersync-sqlite-core (0.1.6)
- powersync-sqlite-core (0.2.1)
- powersync_flutter_libs (0.0.1):
- Flutter
- powersync-sqlite-core (~> 0.1.6)
- powersync-sqlite-core (~> 0.2.1)
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- "sqlite3 (3.46.0+1)":
- "sqlite3/common (= 3.46.0+1)"
- "sqlite3/common (3.46.0+1)"
- "sqlite3/dbstatvtab (3.46.0+1)":
- "sqlite3 (3.46.1+1)":
- "sqlite3/common (= 3.46.1+1)"
- "sqlite3/common (3.46.1+1)"
- "sqlite3/dbstatvtab (3.46.1+1)":
- sqlite3/common
- "sqlite3/fts5 (3.46.0+1)":
- "sqlite3/fts5 (3.46.1+1)":
- sqlite3/common
- "sqlite3/perf-threadsafe (3.46.0+1)":
- "sqlite3/perf-threadsafe (3.46.1+1)":
- sqlite3/common
- "sqlite3/rtree (3.46.0+1)":
- "sqlite3/rtree (3.46.1+1)":
- sqlite3/common
- sqlite3_flutter_libs (0.0.1):
- Flutter
Expand Down Expand Up @@ -69,14 +69,14 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/url_launcher_ios/ios"

SPEC CHECKSUMS:
app_links: e70ca16b4b0f88253b3b3660200d4a10b4ea9795
camera_avfoundation: 759172d1a77ae7be0de08fc104cfb79738b8a59e
app_links: e7a6750a915a9e161c58d91bc610e8cd1d4d0ad0
camera_avfoundation: dd002b0330f4981e1bbcb46ae9b62829237459a4
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
powersync-sqlite-core: 4c38c8f470f6dca61346789fd5436a6826d1e3dd
powersync_flutter_libs: 5d6b132a398de442c0853a8b14bfbb62cd4ff5a1
powersync-sqlite-core: 38ead13d8b21920cfbc79e9b3415b833574a506d
powersync_flutter_libs: 9d26987384a376a18879b9d4fa71629407683163
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqlite3: 292c3e1bfe89f64e51ea7fc7dab9182a017c8630
sqlite3: 0bb0e6389d824e40296f531b858a2a0b71c0d2fb
sqlite3_flutter_libs: c00457ebd31e59fa6bb830380ddba24d44fbcd3b
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe

Expand Down
24 changes: 12 additions & 12 deletions demos/supabase-todolist/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ PODS:
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- powersync-sqlite-core (0.1.6)
- powersync-sqlite-core (0.2.1)
- powersync_flutter_libs (0.0.1):
- FlutterMacOS
- powersync-sqlite-core (~> 0.1.6)
- powersync-sqlite-core (~> 0.2.1)
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- "sqlite3 (3.46.0+1)":
- "sqlite3/common (= 3.46.0+1)"
- "sqlite3/common (3.46.0+1)"
- "sqlite3/dbstatvtab (3.46.0+1)":
- "sqlite3 (3.46.1+1)":
- "sqlite3/common (= 3.46.1+1)"
- "sqlite3/common (3.46.1+1)"
- "sqlite3/dbstatvtab (3.46.1+1)":
- sqlite3/common
- "sqlite3/fts5 (3.46.0+1)":
- "sqlite3/fts5 (3.46.1+1)":
- sqlite3/common
- "sqlite3/perf-threadsafe (3.46.0+1)":
- "sqlite3/perf-threadsafe (3.46.1+1)":
- sqlite3/common
- "sqlite3/rtree (3.46.0+1)":
- "sqlite3/rtree (3.46.1+1)":
- sqlite3/common
- sqlite3_flutter_libs (0.0.1):
- FlutterMacOS
Expand Down Expand Up @@ -67,10 +67,10 @@ SPEC CHECKSUMS:
app_links: 10e0a0ab602ffaf34d142cd4862f29d34b303b2a
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
powersync-sqlite-core: 4c38c8f470f6dca61346789fd5436a6826d1e3dd
powersync_flutter_libs: 1eb1c6790a72afe08e68d4cc489d71ab61da32ee
powersync-sqlite-core: 38ead13d8b21920cfbc79e9b3415b833574a506d
powersync_flutter_libs: 3f05f43c382c77cb7bec64785c2b6b1e9bd33c22
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqlite3: 292c3e1bfe89f64e51ea7fc7dab9182a017c8630
sqlite3: 0bb0e6389d824e40296f531b858a2a0b71c0d2fb
sqlite3_flutter_libs: 5ca46c1a04eddfbeeb5b16566164aa7ad1616e7b
url_launcher_macos: 5f437abeda8c85500ceb03f5c1938a8c5a705399

Expand Down
4 changes: 2 additions & 2 deletions demos/supabase-todolist/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ environment:
dependencies:
flutter:
sdk: flutter
powersync_attachments_helper: ^0.6.6
powersync: ^1.8.2
powersync_attachments_helper: ^0.6.7
powersync: ^1.8.3
path_provider: ^2.1.1
supabase_flutter: ^2.0.1
path: ^1.8.3
Expand Down
8 changes: 6 additions & 2 deletions packages/powersync/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
## 1.8.3

- **FIX**: Pass maxReaders parameter to `PowerSyncDatabase.withFactory()`

## 1.8.2

- Added `refreshSchema()`, allowing queries and watch calls to work against updated schemas.
- Added `refreshSchema()`, allowing queries and watch calls to work against updated schemas.

## 1.8.1

- Fix powersync_flutter_libs dependency
- Fix powersync_flutter_libs dependency

## 1.8.0

Expand Down
4 changes: 2 additions & 2 deletions packages/powersync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# PowerSync SDK for Dart/Flutter

_[PowerSync](https://www.powersync.com) is a Postgres-SQLite sync layer, which helps developers to create local-first real-time reactive apps that work seamlessly both online and offline._
*[PowerSync](https://www.powersync.com) is a sync engine for building local-first apps with instantly-responsive UI/UX and simplified state transfer. Syncs between SQLite on the client-side and Postgres or MongoDB on the server-side (MySQL coming soon).*

This package (`powersync`) is the PowerSync client SDK for Dart/Flutter.

Expand All @@ -20,7 +20,7 @@ flutter pub add powersync

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 - Open alpha _**
## **Web support - Open alpha**

Web support in version 1.6.0 is currently in its alpha stage. This README has been updated to reflect changes relevant to this alpha release.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class PowerSyncDatabaseImpl
// ignore: deprecated_member_use_from_same_package
PowerSyncOpenFactory(path: path, sqliteSetup: sqliteSetup);
return PowerSyncDatabaseImpl.withFactory(factory,
schema: schema, logger: logger);
schema: schema, maxReaders: maxReaders, logger: logger);
}

/// Open a [PowerSyncDatabase] with a [PowerSyncOpenFactory].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ abstract class PowerSyncDatabase
int maxReaders = SqliteDatabase.defaultMaxReaders,
Logger? logger}) {
return PowerSyncDatabaseImpl.withFactory(openFactory,
schema: schema, logger: logger);
schema: schema, maxReaders: maxReaders, logger: logger);
}

/// Open a PowerSyncDatabase on an existing [SqliteDatabase].
Expand Down
2 changes: 1 addition & 1 deletion packages/powersync/lib/src/version.dart
Original file line number Diff line number Diff line change
@@ -1 +1 @@
const String libraryVersion = '1.8.2';
const String libraryVersion = '1.8.3';
4 changes: 2 additions & 2 deletions packages/powersync/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: powersync
version: 1.8.2
version: 1.8.3
homepage: https://powersync.com
repository: https://github.com/powersync-ja/powersync.dart
description: PowerSync Flutter SDK - keep PostgreSQL databases in sync with on-device SQLite databases.
description: PowerSync Flutter SDK - sync engine for building local-first apps.
environment:
sdk: ^3.4.0
dependencies:
Expand Down
4 changes: 4 additions & 0 deletions packages/powersync_attachments_helper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.7

- Update a dependency to the latest release.

## 0.6.6

- Update a dependency to the latest release.
Expand Down
4 changes: 2 additions & 2 deletions packages/powersync_attachments_helper/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: powersync_attachments_helper
description: A helper library for handling attachments when using PowerSync.
version: 0.6.6
version: 0.6.7
repository: https://github.com/powersync-ja/powersync.dart
homepage: https://www.powersync.com/
environment:
Expand All @@ -10,7 +10,7 @@ dependencies:
flutter:
sdk: flutter

powersync: ^1.8.2
powersync: ^1.8.3
logging: ^1.2.0
sqlite_async: ^0.8.3
path_provider: ^2.0.13
Expand Down

0 comments on commit 8f74f9c

Please sign in to comment.