Skip to content

Commit

Permalink
feat(client): Add ELECTRIC_FEATURES option to CLI for ease of use (#1304
Browse files Browse the repository at this point in the history
)

As #768 adds the read-only
permissions as an experimental feature enabled via the
`ELECTRIC_FEATURES` environment variable, I found it useful to have it
in the CLI as well.

Will open respective docs PR as well if people agree with adding this
env var to the CLI.
  • Loading branch information
msfstef committed Jun 4, 2024
1 parent 269bb0f commit 25523d9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/strange-keys-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"electric-sql": patch
---

Add experimental feature flag `ELECTRIC_FEATURES` environment variable to CLI options
7 changes: 7 additions & 0 deletions clients/typescript/src/cli/config-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,11 @@ export const configOptions: Record<string, any> = {
doc: 'The name to use for the Docker container.',
groups: ['electric'],
},
ELECTRIC_FEATURES: {
valueType: String,
valueTypeName: 'features',
defaultVal: '',
doc: 'Flags to enable experimental features',
groups: ['electric'],
},
} as const
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@ services:
AUTH_JWT_ISS: ${AUTH_JWT_ISS:-}
AUTH_JWT_KEY: ${AUTH_JWT_KEY:-}
AUTH_JWT_NAMESPACE: ${AUTH_JWT_NAMESPACE:-}
ELECTRIC_FEATURES: ${ELECTRIC_FEATURES:-}
depends_on:
- postgres
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ services:
AUTH_JWT_ISS: ${AUTH_JWT_ISS:-}
AUTH_JWT_KEY: ${AUTH_JWT_KEY:-}
AUTH_JWT_NAMESPACE: ${AUTH_JWT_NAMESPACE:-}
ELECTRIC_FEATURES: ${ELECTRIC_FEATURES:-}
1 change: 1 addition & 0 deletions clients/typescript/test/cli/config-options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const expectedEnvVars = [
'POSTGRESQL_IMAGE',
'ELECTRIC_IMAGE',
'CONTAINER_NAME',
'ELECTRIC_FEATURES',
]

test('assert that all expected env vars are options for CLI', (t) => {
Expand Down

0 comments on commit 25523d9

Please sign in to comment.