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
cb19c582 - chore (cli): extract cli to separate package (#1317)
2024-06-25 13:45:14 +0000 - Kevin
electric-sql/electric@cb19c582
  • Loading branch information
davidmartos96 committed Jun 25, 2024
1 parent c1f1671 commit db8045d
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 1 deletion.
2 changes: 1 addition & 1 deletion 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: `a94e860c048470df8025302acdb8f7f2fd13f51a`
* Commit: `cb19c582adca3dfff58bbb8dcc56c683dd60109b`


### What is ElectricSQL?
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"format": "SatOpMigrate",
"ops": [
"GocBCgVzdGFycxISCgJpZBIEVEVYVBoGCgR0ZXh0EhoKCmF2YXRhcl91cmwSBFRFWFQaBgoEdGV4dBIUCgRuYW1lEgRURVhUGgYKBHRleHQSGgoKc3RhcnJlZF9hdBIEVEVYVBoGCgR0ZXh0EhgKCHVzZXJuYW1lEgRURVhUGgYKBHRleHQiAmlkChIyMDIzMDYxMzExMjcyNV84MTQS1QES0gFDUkVBVEUgVEFCTEUgInN0YXJzIiAoCiAgImlkIiBURVhUIE5PVCBOVUxMLAogICJhdmF0YXJfdXJsIiBURVhUIE5PVCBOVUxMLAogICJuYW1lIiBURVhULAogICJzdGFycmVkX2F0IiBURVhUIE5PVCBOVUxMLAogICJ1c2VybmFtZSIgVEVYVCBOT1QgTlVMTCwKICBDT05TVFJBSU5UICJzdGFyc19wa2V5IiBQUklNQVJZIEtFWSAoImlkIikKKSBXSVRIT1VUIFJPV0lEOwo="
],
"protocol_version": "Electric.Satellite",
"version": "20230613112725_814"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE TABLE "stars" (
"id" TEXT NOT NULL,
"avatar_url" TEXT NOT NULL,
"name" TEXT,
"starred_at" TEXT NOT NULL,
"username" TEXT NOT NULL,
CONSTRAINT "stars_pkey" PRIMARY KEY ("id")
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"format": "SatOpMigrate",
"ops": [
"Gk4KBWJlZXJzEhIKAmlkEgRURVhUGgYKBHRleHQSFwoHc3Rhcl9pZBIEVEVYVBoGCgR0ZXh0GhQKB3N0YXJfaWQSBXN0YXJzGgJpZCICaWQKEjIwMjMwNjEzMTEyNzM1Xzk5MhLVARLSAUNSRUFURSBUQUJMRSAiYmVlcnMiICgKICAiaWQiIFRFWFQgTk9UIE5VTEwsCiAgInN0YXJfaWQiIFRFWFQsCiAgQ09OU1RSQUlOVCAiYmVlcnNfc3Rhcl9pZF9ma2V5IiBGT1JFSUdOIEtFWSAoInN0YXJfaWQiKSBSRUZFUkVOQ0VTICJzdGFycyIgKCJpZCIpLAogIENPTlNUUkFJTlQgImJlZXJzX3BrZXkiIFBSSU1BUlkgS0VZICgiaWQiKQopIFdJVEhPVVQgUk9XSUQ7Cg=="
],
"protocol_version": "Electric.Satellite",
"version": "20230613112735_992"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE TABLE "beers" (
"id" TEXT NOT NULL,
"star_id" TEXT,
CONSTRAINT "beers_star_id_fkey" FOREIGN KEY ("star_id") REFERENCES "stars" ("id"),
CONSTRAINT "beers_pkey" PRIMARY KEY ("id")
);
23 changes: 23 additions & 0 deletions packages/electricsql_cli/test/src/cli/migrations/builder_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import 'dart:io';

import 'package:electricsql/migrators.dart';
import 'package:electricsql_cli/src/commands/generate/builder.dart';
import 'package:path/path.dart';
import 'package:test/test.dart';

void main() {
final migrationsFolder = Directory(
join(
Directory.current.path,
'../electricsql/test/migrators/support/migrations',
),
);

test('read migration meta data', () async {
for (final builder in [kSqliteQueryBuilder, kPostgresQueryBuilder]) {
final migrations = await loadMigrations(migrationsFolder, builder);
final versions = migrations.map((m) => m.version);
expect(versions, ['20230613112725_814', '20230613112735_992']);
}
});
}

0 comments on commit db8045d

Please sign in to comment.