Skip to content

Commit 9d101bd

Browse files
committed
Merge branch 'main' into offload-queries
2 parents c60461b + 77d33d4 commit 9d101bd

20 files changed

Lines changed: 722 additions & 738 deletions

File tree

.github/workflows/release.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,25 @@ jobs:
1818
- name: Setup .NET SDK
1919
uses: actions/setup-dotnet@v4
2020
with:
21-
dotnet-version: '8.0.x'
21+
dotnet-version: "8.0.x"
2222

2323
- name: Install MAUI Workloads
2424
run: dotnet workload restore
2525

2626
- name: Download PowerSync extension
27-
run: dotnet run --project Tools/Setup
27+
run: dotnet run --project Tools/Setup
2828

2929
- name: Restore dependencies
3030
run: dotnet restore
31-
31+
3232
- name: Extract Common Package Version from CHANGELOG.md
3333
id: extract_version
3434
shell: bash
3535
run: |
36-
VERSION=$(awk '/^## [0-9]+\.[0-9]+\.[0-9]+/ {print $2; exit}' PowerSync/PowerSync.Common/CHANGELOG.md)
37-
echo "Detected Version: $VERSION"
38-
echo "VERSION=$VERSION" >> $GITHUB_ENV
36+
COMMON_VERSION=$(awk '/^## [0-9]+\.[0-9]+\.[0-9]+/ {print $2; exit}' PowerSync/PowerSync.Common/CHANGELOG.md)
37+
echo "Detected Version: $COMMON_VERSION"
38+
echo "VERSION=$COMMON_VERSION" >> $GITHUB_ENV
39+
echo "COMMON_VERSION=$COMMON_VERSION" >> $GITHUB_ENV
3940
4041
- name: Run Pack for Common
4142
run: dotnet pack PowerSync/PowerSync.Common -c Release -o ${{ github.workspace }}/output
@@ -51,7 +52,8 @@ jobs:
5152
MAUI_VERSION=$(awk '/^## [0-9]+\.[0-9]+\.[0-9]+/ {print $2; exit}' PowerSync/PowerSync.Maui/CHANGELOG.md)
5253
echo "Detected Version: $MAUI_VERSION"
5354
echo "VERSION=$MAUI_VERSION" >> $GITHUB_ENV
54-
55+
echo "MAUI_VERSION=$MAUI_VERSION" >> $GITHUB_ENV
56+
5557
- name: Build MAUI Project
5658
run: dotnet build PowerSync/PowerSync.Maui -c Release
5759

@@ -60,4 +62,21 @@ jobs:
6062

6163
- name: Run Push For MAUI
6264
continue-on-error: true
63-
run: dotnet nuget push ${{ github.workspace }}/output/PowerSync.Maui*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
65+
run: dotnet nuget push ${{ github.workspace }}/output/PowerSync.Maui*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
66+
67+
- name: Create GitHub Releases
68+
env:
69+
GH_TOKEN: ${{ github.token }}
70+
run: |
71+
gh release create "PowerSync.Common@${{ env.COMMON_VERSION }}" \
72+
--prerelease \
73+
--title "PowerSync.Common@${{ env.COMMON_VERSION }}" \
74+
--target main \
75+
--generate-notes \
76+
${{ github.workspace }}/output/PowerSync.Common*.nupkg
77+
gh release create "PowerSync.Maui@${{ env.MAUI_VERSION }}" \
78+
--prerelease \
79+
--title "PowerSync.Maui@${{ env.MAUI_VERSION }}" \
80+
--target main \
81+
--generate-notes \
82+
${{ github.workspace }}/output/PowerSync.Maui*.nupkg

PowerSync/PowerSync.Common/CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# PowerSync.Common Changelog
22

3+
## 0.0.11-alpha.1
4+
5+
- Removed the `RunListener` and `RunListenerAsync` APIs from `IEventStream`. Users are encouraged to use the `Listen` or `ListenAsync` APIs instead (`RunListener` itself was implemented using the `Listen` API).
6+
- Changed the `PowerSyncDatabase.Watch` syntax to return an IAsyncEnumerable instead of accepting a callback. This allows users to handle database changes when they are ready instead of us eagerly running the callback as soon as a change is detected.
7+
8+
```csharp
9+
// Optional cancellation token
10+
var cts = new CancellationTokenSource();
11+
12+
// Register listener synchronously on the calling thread...
13+
var listener = db.Watch<Todo>(
14+
"SELECT * FROM todos",
15+
[],
16+
new SQLWatchOptions { Signal = cts.Token }
17+
);
18+
19+
// ...then listen to changes on another thread
20+
_ = Task.Run(async () =>
21+
{
22+
await foreach (var result in listener)
23+
{
24+
Console.WriteLine($"Number of todos: {result.Length}");
25+
}
26+
}, cts.Token);
27+
28+
// Stop watching by cancelling token
29+
cts.Cancel();
30+
```
31+
332
## 0.0.10-alpha.1
433

534
- Fixed watched queries sometimes resolving to the wrong underlying tables after a schema change.

0 commit comments

Comments
 (0)