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
{{ message }}
Repository navigation
Commit 7c8e018
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(eql-bindings): compile eql_bindings::v4 only with the stack-encrypt feature
Only Stack Encrypt produces an EQL v4 value, yet the v4 module compiled
without the feature and every generated derive, stash attribute and doc
line was wrapped in its own cfg_attr on it. The module itself is now gated
in lib.rs, and eql-codegen emits the v4 derives and docs unconditionally.
v4_parity.rs runs under the feature, where test:encryption runs it.
The Go docs listing what encrypt_into takes (encrypt/doc.go and the
stashgen README) now name the four number equality types, and say which
types answer Eq and which are stored and read only.
Claude-Session: https://claude.ai/code/session_01BZhkvKLpNtKuzj3HCfMXoL
Copy file name to clipboardExpand all lines: .changeset/eql-v4-bindings.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,6 @@
2
2
'@cipherstash/eql': minor
3
3
---
4
4
5
-
**The `eql-bindings` crate has an `eql_bindings::v4` module: payload types for the EQL v4 domains.** EQL v4 is the v3 SQL installed under a second name (ADR-0002), for values written by Stack Encrypt. The module is generated from the same catalog as `v3`, with `eql_v4_*` domain names and `"v": 4`. `SchemaVersion` is now generic over the version it admits: `v3::SchemaVersion` is `SchemaVersion<3>` and `v4::SchemaVersion` is `SchemaVersion<4>`, each refusing the other's payloads, and plain `SchemaVersion` still means v3. Only v4 types derive Stack Encrypt's `EncryptFrom` and `DecryptInto`, and the Stack Encrypt target table (now `eql_bindings::v4::targets`) names v4 domains. Besides `TextEq`, Stack Encrypt now produces the storage-only types `Text`, `Integer`, `Bigint`, `Boolean`, `Real` and `Double`, and `TextMatch` (3-grams, `k = 6`, a 2048-bit filter, pinned as `eql_bindings::encryption::EqlMatch`; text shorter than three characters is refused, stored or queried, and only `stored @@ query` matches until #1171 is fixed), from the plaintext types in `eql_bindings::encryption::plaintext`; the Go SDK's `encrypt/eql` table marks them producible. Stack Encrypt also produces the number equality types `IntegerEq`, `BigintEq`, `RealEq` and `DoubleEq`, whose `=` compares as PostgreSQL compares the plain types: an integer has one term whatever its width, and for floats `-0.0 = 0.0` and `NaN = NaN` (ADR-0002's semantic baseline). Every type it cannot produce yet names the issue that tracks its blocker.
5
+
**The `eql-bindings` crate has an `eql_bindings::v4` module, with the `stack-encrypt` feature: payload types for the EQL v4 domains.** EQL v4 is the v3 SQL installed under a second name (ADR-0002), for values written by Stack Encrypt, so the module exists only with that feature and its types derive Stack Encrypt's traits without a further gate. The module is generated from the same catalog as `v3`, with `eql_v4_*` domain names and `"v": 4`. `SchemaVersion` is now generic over the version it admits: `v3::SchemaVersion` is `SchemaVersion<3>` and `v4::SchemaVersion` is `SchemaVersion<4>`, each refusing the other's payloads, and plain `SchemaVersion` still means v3. Only v4 types derive Stack Encrypt's `EncryptFrom` and `DecryptInto`, and the Stack Encrypt target table (now `eql_bindings::v4::targets`) names v4 domains. Besides `TextEq`, Stack Encrypt now produces the storage-only types `Text`, `Integer`, `Bigint`, `Boolean`, `Real` and `Double`, and `TextMatch` (3-grams, `k = 6`, a 2048-bit filter, pinned as `eql_bindings::encryption::EqlMatch`; text shorter than three characters is refused, stored or queried, and only `stored @@ query` matches until #1171 is fixed), from the plaintext types in `eql_bindings::encryption::plaintext`; the Go SDK's `encrypt/eql` table marks them producible. Stack Encrypt also produces the number equality types `IntegerEq`, `BigintEq`, `RealEq` and `DoubleEq`, whose `=` compares as PostgreSQL compares the plain types: an integer has one term whatever its width, and for floats `-0.0 = 0.0` and `NaN = NaN` (ADR-0002's semantic baseline). Every type it cannot produce yet names the issue that tracks its blocker.
6
6
7
7
Nothing a released version shipped has changed. The v3 types, the v3 SQL and the TypeScript package are as they were; the `stack-encrypt` derives on the v3 text types and the `v3::targets` module were added after the last release and are moved to v4 here, not removed from a release.
Copy file name to clipboardExpand all lines: languages/golang/cmd/stashgen/README.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,11 +159,13 @@ The engine produces these EQL types today, each from one Go field type:
159
159
|`encrypt_into`| Go field |
160
160
|---|---|
161
161
|`TextEq`, `Text`, `TextMatch`|`string`|
162
-
|`Integer`|`int32`|
163
-
|`Bigint`|`int64`|
162
+
|`Integer`, `IntegerEq`|`int32`|
163
+
|`Bigint`, `BigintEq`|`int64`|
164
164
|`Boolean`|`bool`|
165
-
|`Real`|`float32`|
166
-
|`Double`|`float64`|
165
+
|`Real`, `RealEq`|`float32`|
166
+
|`Double`, `DoubleEq`|`float64`|
167
+
168
+
The `Eq` types answer `Eq`; `Text`, `Integer`, `Bigint`, `Boolean`, `Real` and `Double` are stored and read only, with no query method.
167
169
168
170
The width must match: an `int` or `int64` field is not an `Integer`, and a `float64` field is not a `Real`.
169
171
A `TextMatch` field refuses text shorter than three characters, such as an empty string or a two-letter code, because it has no 3-grams to index; its query refuses such text too.
Copy file name to clipboardExpand all lines: packages/eql/crates/eql-bindings/src/v4/bigint.rs
+24-74Lines changed: 24 additions & 74 deletions
Original file line number
Diff line number
Diff line change
@@ -14,35 +14,18 @@ use ts_rs::TS;
14
14
doc,
15
15
doc = " See the [EQL bigint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples."
16
16
)]
17
-
#[cfg_attr(doc, doc = "")]
18
-
#[cfg_attr(
19
-
all(doc, feature = "stack-encrypt"),
20
-
doc = " Plaintext input and decrypted output: [`Int64`](crate::encryption::plaintext::Int64). With the `stack-encrypt` feature, implements `EncryptFrom<Int64>` and `DecryptInto<Int64>`."
21
-
)]
22
-
#[cfg_attr(
23
-
all(doc, not(feature = "stack-encrypt")),
24
-
doc = " Plaintext input and decrypted output: `Int64`. With the `stack-encrypt` feature, implements `EncryptFrom<Int64>` and `DecryptInto<Int64>`."
25
-
)]
26
-
#[cfg_attr(
27
-
all(doc, feature = "stack-encrypt"),
28
-
doc = " Encryption context: `NonEmpty<Identifier>`, constructed with `Identifier::for_column(table, column)` and stored in `i`."
29
-
)]
30
-
#[cfg_attr(
31
-
all(doc, feature = "stack-encrypt"),
32
-
doc = " See the [complete encryption example](crate::encryption#example)."
doc = " See the [EQL bigint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples."
82
65
)]
83
-
#[cfg_attr(doc, doc = "")]
84
-
#[cfg_attr(
85
-
all(doc, feature = "stack-encrypt"),
86
-
doc = " Plaintext input and decrypted output: [`Int64`](crate::encryption::plaintext::Int64). With the `stack-encrypt` feature, implements `EncryptFrom<Int64>` and `DecryptInto<Int64>`."
87
-
)]
88
-
#[cfg_attr(
89
-
all(doc, not(feature = "stack-encrypt")),
90
-
doc = " Plaintext input and decrypted output: `Int64`. With the `stack-encrypt` feature, implements `EncryptFrom<Int64>` and `DecryptInto<Int64>`."
91
-
)]
92
-
#[cfg_attr(
93
-
all(doc, feature = "stack-encrypt"),
94
-
doc = " Encryption context: `NonEmpty<Identifier>`, constructed with `Identifier::for_column(table, column)` and stored in `i`."
95
-
)]
96
-
#[cfg_attr(
97
-
all(doc, feature = "stack-encrypt"),
98
-
doc = " See the [complete encryption example](crate::encryption#example)."
@@ -273,34 +239,18 @@ impl DomainType for BigintOrdOpe {
273
239
doc,
274
240
doc = " See the [EQL bigint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples."
275
241
)]
276
-
#[cfg_attr(doc, doc = "")]
277
-
#[cfg_attr(
278
-
all(doc, feature = "stack-encrypt"),
279
-
doc = " Plaintext input: [`Int64`](crate::encryption::plaintext::Int64). With the `stack-encrypt` feature, implements `EncryptFrom<Int64>` to build equality query terms. Query operands do not decrypt."
280
-
)]
281
-
#[cfg_attr(
282
-
all(doc, not(feature = "stack-encrypt")),
283
-
doc = " Plaintext input: `Int64`. With the `stack-encrypt` feature, implements `EncryptFrom<Int64>` to build equality query terms. Query operands do not decrypt."
284
-
)]
285
-
#[cfg_attr(
286
-
all(doc, feature = "stack-encrypt"),
287
-
doc = " Encryption context: `NonEmpty<Identifier>`, constructed with `Identifier::for_column(table, column)` and stored in `i`."
288
-
)]
289
-
#[cfg_attr(
290
-
all(doc, feature = "stack-encrypt"),
291
-
doc = " See the [complete encryption example](crate::encryption#example)."
Copy file name to clipboardExpand all lines: packages/eql/crates/eql-bindings/src/v4/boolean.rs
+8-25Lines changed: 8 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -14,35 +14,18 @@ use ts_rs::TS;
14
14
doc,
15
15
doc = " See the [EQL boolean reference](https://cipherstash.com/docs/reference/eql/booleans) for SQL domain variants, operators, and query examples."
16
16
)]
17
-
#[cfg_attr(doc, doc = "")]
18
-
#[cfg_attr(
19
-
all(doc, feature = "stack-encrypt"),
20
-
doc = " Plaintext input and decrypted output: [`Bool`](crate::encryption::plaintext::Bool). With the `stack-encrypt` feature, implements `EncryptFrom<Bool>` and `DecryptInto<Bool>`."
21
-
)]
22
-
#[cfg_attr(
23
-
all(doc, not(feature = "stack-encrypt")),
24
-
doc = " Plaintext input and decrypted output: `Bool`. With the `stack-encrypt` feature, implements `EncryptFrom<Bool>` and `DecryptInto<Bool>`."
25
-
)]
26
-
#[cfg_attr(
27
-
all(doc, feature = "stack-encrypt"),
28
-
doc = " Encryption context: `NonEmpty<Identifier>`, constructed with `Identifier::for_column(table, column)` and stored in `i`."
29
-
)]
30
-
#[cfg_attr(
31
-
all(doc, feature = "stack-encrypt"),
32
-
doc = " See the [complete encryption example](crate::encryption#example)."
0 commit comments