You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(prisma-example): convert the example app to EQL v3
Schema: every column is a concrete public.eql_v3_* domain
(EncryptedTextSearch / EncryptedDoubleOrd / EncryptedBigIntOrd /
EncryptedDateOrd / EncryptedBoolean / EncryptedJson); wiring via
cipherstashFromStackV3. Migrations regenerated from the v3 contract —
initial app migration carries zero add_search_config ops; the
cipherstash space ships both bundle baselines.
E2E suites adapted to the v3 surface and green from a wiped database
(7 files / 40 tests, live PG + ZeroKMS): equality/range/free-text
tokens, order-term sorting, JSON @> containment (positive, negative,
multi-key, nested, empty-needle rejection), lossless bigint beyond
MAX_SAFE_INTEGER, and eql_v3_boolean's storage-only operator refusal
pinned as a feature. README walkthrough e2e (repo-level) also green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Convert the example app to EQL v3. Every column is now a concrete `public.eql_v3_*` domain authored with the per-domain constructors (`EncryptedTextSearch`, `EncryptedDoubleOrd`, `EncryptedBigIntOrd`, `EncryptedDateOrd`, `EncryptedBoolean`, `EncryptedJson`), wired through `cipherstashFromStackV3({ contractJson })`. The e2e harness runs the full v3 surface against live Postgres + ZeroKMS with no skips: equality/range/free-text-token operators, `cipherstashV3Asc`/`Desc` order-term sorting, encrypted JSON containment (`cipherstashJsonContains` — the v2 `cipherstashJsonb*` helpers do not exist in v3), lossless `bigint` beyond `Number.MAX_SAFE_INTEGER`, and the storage-only `eql_v3_boolean` refusal (`EncryptionOperatorError`) pinned as a feature. Migrations regenerate from the v3 contract: the initial app migration creates the `users` table against the v3 domains with zero `add_search_config` ops, and the cipherstash space carries both bundle baselines (v2 + v3).
Copy file name to clipboardExpand all lines: examples/prisma/README.md
+36-17Lines changed: 36 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,17 @@
1
1
# @cipherstash/prisma-next example
2
2
3
-
End-to-end demo of [`@cipherstash/prisma-next`](../../packages/prisma-next/README.md): searchable application-layer encryption for Postgres with [Prisma Next](https://www.npmjs.com/package/@prisma-next/cli), using [`@cipherstash/stack`](../../packages/stack/README.md) as the encryption SDK.
3
+
End-to-end demo of [`@cipherstash/prisma-next`](../../packages/prisma-next/README.md): searchable application-layer encryption for Postgres with [Prisma Next](https://www.npmjs.com/package/@prisma-next/cli), using [`@cipherstash/stack`](../../packages/stack/README.md) as the encryption SDK — on **EQL v3**, where every encrypted column is a concrete `public.eql_v3_*` Postgres domain and the constructor you pick *is* the capability set.
4
4
5
-
A single `User` model with one column per cipherstash codec (string, double, bigint, date, boolean, JSON), exercised end-to-end: insert, equality, free-text search, range, between, in-array, sort, and `decryptAll`-amortised read.
5
+
A single `User` model with one column per plaintext family, exercised end-to-end: insert, equality, free-text token search, range, between, in-array, encrypted-order-term sort, JSON containment, and `decryptAll`-amortised read.
📖 See the [Prisma Next encryption docs](https://cipherstash.com/docs/stack/cipherstash/encryption/prisma-next) for the full operator reference, security model, and known limitations.
8
17
@@ -11,12 +20,12 @@ A single `User` model with one column per cipherstash codec (string, double, big
--- cipherstashV3Asc (encrypted order-term ORDER BY) ---
83
97
user-0: email=alice@example.com
84
98
user-1: email=bob@example.com
85
99
user-2: email=carol@example.com
86
100
user-3: email=dave@otherorg.test
87
101
```
88
102
103
+
Two v3 behaviours worth noticing in that output:
104
+
105
+
-**`cipherstashIlike` is bloom-filter token containment** (`eql_v3.contains`), not SQL `ILIKE` — the needle's tokens must appear in the ciphertext's index. Plain substrings like `example.com` are the idiomatic needle; `%` wildcards are not part of the model.
106
+
-**`eql_v3_boolean` is storage-only.** It round-trips `true`/`false` losslessly but surfaces no search operators — calling one throws `EncryptionOperatorError`. Filter on a searchable column and decrypt the boolean from the result set.
107
+
89
108
## References
90
109
91
110
- 📖 [Prisma Next encryption docs](https://cipherstash.com/docs/stack/cipherstash/encryption/prisma-next) — the canonical reference.
0 commit comments