Push and status
Push your CipherStash encryption schema to PostgreSQL and use db status and test-connection to check EQL installation and database connectivity.
push
Push your encryption schema to the database.
npx stash db push [options]| Option | Description |
|---|---|
--dry-run | Load and validate the schema, then print it as JSON. No database changes. |
push is only required when using CipherStash Proxy. If you're using the SDK directly (Drizzle, Supabase, or plain PostgreSQL), this step is not needed. The schema lives in your application code.
How push works
When pushing, the CLI:
- Loads the encryption client from the path in
stash.config.ts - Runs schema validation (warns but doesn't block)
- Transforms SDK data types to EQL-compatible
cast_asvalues - Connects to Postgres and marks existing
eql_v2_configurationrows asinactive - Inserts the new config as an
activerow
SDK to EQL type mapping
The SDK uses developer-friendly type names, but EQL expects PostgreSQL-aligned types. The push command maps these automatically:
SDK type (dataType()) | EQL cast_as |
|---|---|
string | text |
text | text |
number | double |
bigint | big_int |
boolean | boolean |
date | date |
json | jsonb |
status
Show the current state of EQL in your database.
npx stash db statusReports:
- Whether EQL is installed and which version
- Database permission status
- Whether an active encrypt config exists in
eql_v2_configuration(only relevant for CipherStash Proxy)
test-connection
Verify that the database URL in your config is valid and the database is reachable.
npx stash db test-connectionReports the database name, connected user/role, and PostgreSQL server version. Useful for debugging connection issues before running install or push.
Schema validation
Use stash db validate to check your CipherStash encryption schema for misconfigurations, with rules for search types, indexes, and operator families.
Programmatic API
Import the stash package programmatically to install EQL, load and validate stash.config.ts, and build custom CipherStash tooling or CI scripts.