Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Upstream changes
Browse files Browse the repository at this point in the history
837ce928 - feat (client): extract sync API and make DAL optional (#1355)
2024-06-26 11:51:06 +0000 - Kevin
electric-sql/electric@837ce928
  • Loading branch information
davidmartos96 committed Jun 28, 2024
1 parent cf99d34 commit d271d60
Show file tree
Hide file tree
Showing 63 changed files with 2,868 additions and 613 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,26 @@ env:
# group: e2e-${{ github.workflow }}
# cancel-in-progress: false

concurrency:
group: e2e-${{ github.ref }}
cancel-in-progress: true

jobs:
e2e_satellite_tests:
name: E2E Satellite tests
runs-on: ubuntu-latest
strategy:
matrix:
dialect: [SQLite, Postgres]
dal: [true, false]
name: E2E Satellite tests (Dialect ${{ matrix.dialect }} - uses DAL? ${{ matrix.dal }})
defaults:
run:
working-directory: e2e
env:
# BUILDKITE_ANALYTICS_TOKEN: ${{ secrets.BUILDKITE_TEST_ANALYTICS_E2E }}
ELECTRIC_REPO: e2e/electric_repo
DIALECT: ${{ matrix.dialect }}
DAL: ${{ matrix.dal }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -48,10 +54,10 @@ jobs:

# Make sure that only one E2E workflow is running at the same time
# Ports used in the tests are fixed and cannot be reused
- uses: ahmadnassri/action-workflow-queue@v1
with:
# milliseconds
timeout: 900000 # 15 minutes
# - uses: ahmadnassri/action-workflow-queue@v1
# with:
# # milliseconds
# timeout: 1500000 # 25 minutes

- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Client based on the Typescript client from the `clients/typescript` subfolder fr

* [NPM package](https://www.npmjs.com/package/electric-sql).
* Version `v0.12.1-dev`
* Commit: `5e2e276c81a6fd7a7db3f9a3853b0132e219cba6`
* Commit: `837ce928e3a887ee8a48966efd029224a585e6f1`


### What is ElectricSQL?
Expand Down Expand Up @@ -131,13 +131,13 @@ In this example, projects are synced with all its related content (project issue
final shape = await electric.syncTable(
db.projects,
include: (p) => [
SyncInputRelation.from(
ShapeInputRelation.from(
p.$relations.issues,
include: (i) => [
SyncInputRelation.from(
ShapeInputRelation.from(
i.$relations.comments,
include: (c) => [
SyncInputRelation.from(c.$relations.author),
ShapeInputRelation.from(c.$relations.author),
],
),
],
Expand Down
1 change: 1 addition & 0 deletions e2e/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ start_satellite_client_%:
--rm \
-e TERM=dumb \
-e DIALECT=${DIALECT} \
-e DAL=${DAL} \
satellite_client_$*


Expand Down
6 changes: 5 additions & 1 deletion e2e/satellite_client/db/01-create_e2e_tables.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-- migrate:up

/*
* This migration file defines all the tables used by the e2e tests.
* Use it to migrate a Postgres database and then generate the Electric client from it.
Expand Down Expand Up @@ -92,4 +94,6 @@ CREATE TABLE "blobs" (
blob BYTEA
);

ALTER TABLE "blobs" ENABLE ELECTRIC;
ALTER TABLE "blobs" ENABLE ELECTRIC;

-- migrate:down
10 changes: 5 additions & 5 deletions e2e/satellite_client/lib/cli/prompt.dart
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,11 @@ Future<void> start() async {
command,
getItemColumns,
);
} else if (name == "insert_item") {
} else if (name == "insert_items") {
await processCommand2Params<MyDriftElectricClient, List<dynamic>, void>(
state,
command,
(electric, keys) => insertItem(electric, keys.cast<String>()),
(electric, keys) => insertItems(electric, keys.cast<String>()),
);
} else if (name == "insert_extended_into") {
await processCommand3Params<MyDriftElectricClient, String,
Expand Down Expand Up @@ -317,7 +317,7 @@ Future<void> start() async {
command,
getOtherItems,
);
} else if (name == "insert_other_item") {
} else if (name == "insert_other_items") {
await processCommand2Params<MyDriftElectricClient, List<dynamic>, void>(
state,
command,
Expand Down Expand Up @@ -369,11 +369,11 @@ Future<void> start() async {
return await reconnect(electric, exp);
},
);
} else if (name == "custom_03_25_sync_items") {
} else if (name == "custom_03_26_sync_items") {
await processCommand1Param<MyDriftElectricClient, void>(
state,
command,
custom0325SyncItems,
custom0326SyncItems,
);
} else {
throw Exception("Unknown command: $name");
Expand Down
Loading

0 comments on commit d271d60

Please sign in to comment.