-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore (CLI): introspect PG directly (#534)
This PR modifies the CLI such that the `yarn client:generate` script directly introspects the PG database (via the proxy) as described in #437. (Up till now, we would fetch migrations from Electric endpoint, recreate a local SQLite DB, and introspect that DB). Testing this PR is a bit tricky because the necessary packages are not published. You can test it as follows: - build Electric (`cd components/electric && make docker-build`) - build and pack the ts-client (`cd clients/typescript && pnpm install && pnpm build && pnpm pack`) - build the starter (`cd examples/starter && pnpm install && pnpm build && npm link`) - create an app `create-electric-app my-app` - modify your app to use the local Electric image (because it has not yet been published to Docker hub) i.e. in `my-app/backend/compose/.envrc` change the `ELECTRIC_IMAGE` env var to be `electric:local-build`. - modify your app to use our packed ts-client: - change the electric-sql dependency in `my-app/package.json` to be `"electric-sql": "file:<path to electric mono repo>/clients/typescript/electric-sql-0.6.4.tgz",` - now run the app: - `yarn` - `yarn backend:start` - `yarn db:migrate` - `yarn client:generate` - `yarn start` --------- Co-authored-by: Oleksii Sholik <[email protected]> Co-authored-by: Garry Hill <[email protected]>
- Loading branch information
1 parent
e5fb598
commit cfded69
Showing
6 changed files
with
36 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"electric-sql": patch | ||
"create-electric-app": patch | ||
--- | ||
|
||
Modify CLI to introspect Postgres database through Electric's proxy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters