CipherStashDocs
CipherStash CLI

Schema validation

Use stash db validate to check your CipherStash encryption schema for misconfigurations, with rules for search types, indexes, and operator families.

The validate command checks your encryption schema for common misconfigurations.

npx stash db validate [options]
OptionDescription
--supabaseCheck for Supabase-specific issues (e.g. ORDER BY without operator families)
--exclude-operator-familyCheck for issues when operator families are excluded

Validation rules

RuleSeverityDescription
freeTextSearch on non-string columnWarningFree-text search only works with string data
orderAndRange without operator familiesWarningORDER BY won't work without operator families
No indexes on encrypted columnInfoColumn is encrypted but not searchable
searchableJson without json data typeErrorsearchableJson requires dataType("json")

Examples

Basic validation:

npx stash db validate

Validate with Supabase context (checks for operator family issues):

npx stash db validate --supabase

How validation works

The command loads your encryption schema from the file specified by client in stash.config.ts and runs it through the validation rules.

  • Errors cause the command to exit with code 1.
  • Warnings and info messages are printed but don't cause a non-zero exit.
  • Validation also runs automatically before push. Issues are logged as warnings but don't block the push.

On this page