stash eql
Reference for the `stash eql` commands.
Generated from stash v1.0.0 via npx [email protected] manifest --json. Run npx [email protected] --help to see the live command surface.
The stash eql command group.
eql install
Scaffold stash.config.ts (if missing) and install EQL extensions
npx stash eql install [flags]Flags
| Flag | Description |
|---|---|
--force | Reinstall / overwrite even if already installed. |
--dry-run | Show what would happen without making changes. |
--supabase | Use Supabase-compatible mode (auto-detected from DATABASE_URL). |
--database-url <url> | Database URL for this run only — never written to disk. Highest precedence in the resolution order: --database-url flag → DATABASE_URL env → supabase status → interactive prompt. A stash.config.ts is not a separate tier (its default databaseUrl re-runs this same chain); a hand-set literal databaseUrl in the config bypasses the resolver and wins over all of these. (env: DATABASE_URL) |
eql migration
Generate an EQL v3 install migration for your ORM (Drizzle; Prisma Next installs EQL through its own migrations)
npx stash eql migration [flags]Flags
| Flag | Description |
|---|---|
--drizzle | Emit a Drizzle custom migration containing the EQL v3 install SQL. |
--prisma | Not needed: Prisma Next installs EQL through its own migration framework — run prisma-next migrate instead. |
--supabase | Append the Supabase role grants (eql_v3 + eql_v3_internal for anon/authenticated/service_role). |
--name <name> | Name for the generated migration (Drizzle). Letters, numbers, dashes, underscores only. Defaults to install-eql. |
--out <path> | Directory drizzle-kit writes the migration into (passed to drizzle-kit generate --out). Defaults to drizzle; set it to match your drizzle.config.ts. |
--dry-run | Show what would happen without making changes. |
Examples
npx stash eql migration --drizzle
npx stash eql migration --drizzle --supabaseeql repair
Sweep an existing Drizzle output directory for in-place
ALTER COLUMN ... SET DATA TYPE <eql domain> statements — which cannot run,
because Postgres has no cast from text/numeric to an EQL domain — and rewrite
each into an additive encrypted column that preserves the source column.
This is the same sweep eql migration --drizzle runs, without having to
generate an EQL install migration you do not want just to trigger it.
Migrations the database has already applied are reported and left alone:
rewriting one would leave its .sql describing a shape that database never got
from it, so a fresh CI or staging database replaying the file would silently
diverge. Pass --database-url so that check can run; without it the repair
proceeds and warns that applied state could not be verified. If your
drizzle.config.ts overrides migrations.table / migrations.schema, name
the ledger with --migrations-table — otherwise the check queries the default
relation, finds nothing, and reports applied state as unverified.
npx stash eql repair [flags]Flags
| Flag | Description |
|---|---|
--drizzle | Repair a Drizzle migration directory. |
--out <path> | Directory holding the migrations to sweep. Defaults to drizzle; set it to match your drizzle.config.ts. |
--migrations-table <[schema.]table> | Drizzle's migration ledger, when drizzle.config.ts overrides migrations.table / migrations.schema. Defaults to drizzle.__drizzle_migrations. Only read with --database-url. |
--dry-run | Show what would happen without making changes. |
--database-url <url> | Database URL for this run only — never written to disk. Highest precedence in the resolution order: --database-url flag → DATABASE_URL env → supabase status → interactive prompt. A stash.config.ts is not a separate tier (its default databaseUrl re-runs this same chain); a hand-set literal databaseUrl in the config bypasses the resolver and wins over all of these. (env: DATABASE_URL) |
Examples
npx stash eql repair --drizzle
npx stash eql repair --drizzle --dry-run
npx stash eql repair --drizzle --out db/migrations --database-url postgres://…eql upgrade
Upgrade EQL extensions to the latest version
npx stash eql upgrade [flags]Flags
| Flag | Description |
|---|---|
--dry-run | Show what would happen without making changes. |
--supabase | Use Supabase-compatible mode. |
--database-url <url> | Database URL for this run only — never written to disk. Highest precedence in the resolution order: --database-url flag → DATABASE_URL env → supabase status → interactive prompt. A stash.config.ts is not a separate tier (its default databaseUrl re-runs this same chain); a hand-set literal databaseUrl in the config bypasses the resolver and wins over all of these. (env: DATABASE_URL) |
eql status
Show EQL installation status
npx stash eql status [flags]Flags
| Flag | Description |
|---|---|
--database-url <url> | Database URL for this run only — never written to disk. Highest precedence in the resolution order: --database-url flag → DATABASE_URL env → supabase status → interactive prompt. A stash.config.ts is not a separate tier (its default databaseUrl re-runs this same chain); a hand-set literal databaseUrl in the config bypasses the resolver and wins over all of these. (env: DATABASE_URL) |