diff --git a/.changeset/eql-plan-field-targets.md b/.changeset/eql-plan-field-targets.md index e1fd16c14..ea51799c8 100644 --- a/.changeset/eql-plan-field-targets.md +++ b/.changeset/eql-plan-field-targets.md @@ -2,4 +2,4 @@ '@cipherstash/eql': minor --- -**The `eql-bindings` crate resolves an EQL type named as a string to its own Stack Encrypt plan** (`stack-encrypt` feature). `eql_bindings::encryption::targets` carries a catalog-generated table of every EQL type a data plan may name as a field target — its name across languages, family and suffix, the plaintext `ValueKind` it takes, the indexes it carries, its query twin, and whether the engine can produce it today with the reason when not — and `encrypt` / `decrypt` / `query` entry points that dispatch on the name and run the type's derived `EncryptFrom` / `DecryptInto`, resolving to the EQL value's JSON bytes through the engine's `Pending` so a guest batches it with the rest of a plan. This is the EQL half of EQL types as plan field targets (cipherstash/stack#1062): a Go data plan names `TextEq` and the guest returns the finished EQL value instead of assembling one. `TextEq` is the only producible type; every other name is refused with the plan's reason. The SQL surface and the TypeScript package are unchanged. +**The `eql-bindings` crate resolves an EQL type named as a string to its own Stack Encrypt plan** (`stack-encrypt` feature). `eql_bindings::encryption::targets` carries a catalog-generated table of every EQL type a data plan may name as a field target — its name across languages, family and suffix, the plaintext `ValueKind` it takes, the indexes it carries, its query twin, and whether the engine can produce it today with the reason when not — and `encrypt` / `decrypt` / `query` entry points that dispatch on the name and run the type's derived `EncryptFrom` / `DecryptInto`, resolving to the EQL value's JSON bytes through the engine's `Pending` so a guest batches it with the rest of a plan. This is the EQL half of EQL types as plan field targets (cipherstash/stack#1062): a Go data plan names `TextEq` and the guest returns the finished EQL value instead of assembling one. Every target is an `eql_v4_*` domain. `TextEq` is the only producible type; every other name is refused with the plan's reason. The SQL surface and the TypeScript package are unchanged. diff --git a/.changeset/eql-text-equality-transcoding.md b/.changeset/eql-text-equality-transcoding.md index 969aa9653..cf5651050 100644 --- a/.changeset/eql-text-equality-transcoding.md +++ b/.changeset/eql-text-equality-transcoding.md @@ -2,4 +2,4 @@ '@cipherstash/eql': minor --- -**Rust `TextEq` and `TextEqQuery` support Stack Encrypt's target-directed API behind the `stack-encrypt` feature.** The stored table and column identifier supplies the encryption context; native ciphertext and equality terms are transcoded into EQL payloads while Vitamin C owns plaintext encoding. This is a new producer profile with exact string equality, independent of existing cipherstash-client ciphertext and terms. Query operands carry no recoverable ciphertext. +**Rust `eql_bindings::v4::text::{TextEq, TextEqQuery}` support Stack Encrypt's target-directed API behind the `stack-encrypt` feature.** Stack Encrypt writes EQL v4 only, so the `eql_v3` types carry no Stack Encrypt traits. The stored table and column identifier supplies the encryption context; native ciphertext and equality terms are transcoded into EQL payloads while Vitamin C owns plaintext encoding. This is a new producer profile with exact string equality, independent of existing cipherstash-client ciphertext and terms. Query operands carry no recoverable ciphertext. diff --git a/.changeset/eql-v4-bindings.md b/.changeset/eql-v4-bindings.md new file mode 100644 index 000000000..e29c9aa91 --- /dev/null +++ b/.changeset/eql-v4-bindings.md @@ -0,0 +1,7 @@ +--- +'@cipherstash/eql': minor +--- + +**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. + +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. diff --git a/languages/golang/cmd/stashgen/README.md b/languages/golang/cmd/stashgen/README.md index d3f38554e..b2c521da5 100644 --- a/languages/golang/cmd/stashgen/README.md +++ b/languages/golang/cmd/stashgen/README.md @@ -44,7 +44,7 @@ Your program calls those functions, and it never builds or names a plan. ``` 6. Store the encrypted type. - Each `encrypt_into` field is one EQL column: `eql.TextEq` implements `driver.Valuer` and `sql.Scanner`, so a database library binds and scans it as the JSON a `public.eql_v3_text_eq` column holds. + Each `encrypt_into` field is one EQL column: `eql.TextEq` implements `driver.Valuer` and `sql.Scanner`, so a database library binds and scans it as the JSON a `public.eql_v4_text_eq` column holds. Stack Encrypt writes EQL v4; see the `encrypt` package README. 7. Run the generator again after each change to the struct or to a tag. A change to the fields of the struct stops the build until you do. diff --git a/languages/golang/encrypt/README.md b/languages/golang/encrypt/README.md index 6f8f51904..a5cb8237c 100644 --- a/languages/golang/encrypt/README.md +++ b/languages/golang/encrypt/README.md @@ -276,12 +276,17 @@ package documentation for the full account. ## EQL columns A field tagged `encrypt_into=TextEq` is stored as one EQL value, the JSON -PostgreSQL holds in a `public.eql_v3_text_eq` column, as an `eql.TextEq` -from package `encrypt/eql`. The guest builds the value: the generated code +PostgreSQL holds in a `public.eql_v4_text_eq` column, as an `eql.TextEq` +from package `encrypt/eql`. Stack Encrypt writes EQL v4, the `eql_v4` install +of EQL's SQL; the `eql_v3` columns the TypeScript SDK writes hold +cipherstash-client's terms, which these never match. Install EQL v4 into +PostgreSQL first, with the `eql-v4-install.sql` attached to each Go release +(`psql -f eql-v4-install.sql`); `stash eql install` installs EQL v3 only, and +an `eql_v4_*` column needs the v4 domains. The guest builds the value: the generated code imports `encrypt/eql`, which embeds the build of the engine that holds the EQL types and registers it on import, so the program runs that build and stores what it returns. `Fields.Email.Query` returns the `eql.TextEqQuery` -the column's `eql_v3.query_text_eq` operand takes. `mise run +the column's `eql_v4.query_text_eq` operand takes. `mise run wasm:guest:build:eql` builds that guest beside the other. A cipher extended with a tenant part refuses a struct with an `encrypt_into` field: an EQL value is stored under a table and a column, and the extended label has no diff --git a/languages/golang/encrypt/eql/eql_gen.go b/languages/golang/encrypt/eql/eql_gen.go index 911a82c97..e1bc5688b 100644 --- a/languages/golang/encrypt/eql/eql_gen.go +++ b/languages/golang/encrypt/eql/eql_gen.go @@ -9,60 +9,60 @@ import "database/sql/driver" // engine produces the type today; stashgen refuses encrypt_into for one // it does not, with the Reason. var Types = []Type{ - {Name: "Integer", GoName: "Integer", Family: "integer", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_integer", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "IntegerEq", GoName: "IntegerEq", Family: "integer", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v3_integer_eq", Indexes: []string{"eq"}, Query: "IntegerEqQuery", QuerySQLDomain: "eql_v3.query_integer_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "IntegerOrdOre", GoName: "IntegerOrdOre", Family: "integer", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v3_integer_ord_ore", Indexes: []string{"ore"}, Query: "IntegerOrdOreQuery", QuerySQLDomain: "eql_v3.query_integer_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "IntegerOrd", GoName: "IntegerOrd", Family: "integer", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v3_integer_ord", Indexes: []string{"ope"}, Query: "IntegerOrdQuery", QuerySQLDomain: "eql_v3.query_integer_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "IntegerOrdOpe", GoName: "IntegerOrdOpe", Family: "integer", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v3_integer_ord_ope", Indexes: []string{"ope"}, Query: "IntegerOrdOpeQuery", QuerySQLDomain: "eql_v3.query_integer_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "Smallint", GoName: "Smallint", Family: "smallint", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_smallint", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "SmallintEq", GoName: "SmallintEq", Family: "smallint", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v3_smallint_eq", Indexes: []string{"eq"}, Query: "SmallintEqQuery", QuerySQLDomain: "eql_v3.query_smallint_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "SmallintOrdOre", GoName: "SmallintOrdOre", Family: "smallint", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v3_smallint_ord_ore", Indexes: []string{"ore"}, Query: "SmallintOrdOreQuery", QuerySQLDomain: "eql_v3.query_smallint_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "SmallintOrd", GoName: "SmallintOrd", Family: "smallint", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v3_smallint_ord", Indexes: []string{"ope"}, Query: "SmallintOrdQuery", QuerySQLDomain: "eql_v3.query_smallint_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "SmallintOrdOpe", GoName: "SmallintOrdOpe", Family: "smallint", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v3_smallint_ord_ope", Indexes: []string{"ope"}, Query: "SmallintOrdOpeQuery", QuerySQLDomain: "eql_v3.query_smallint_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "Bigint", GoName: "Bigint", Family: "bigint", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_bigint", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "BigintEq", GoName: "BigintEq", Family: "bigint", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v3_bigint_eq", Indexes: []string{"eq"}, Query: "BigintEqQuery", QuerySQLDomain: "eql_v3.query_bigint_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "BigintOrdOre", GoName: "BigintOrdOre", Family: "bigint", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v3_bigint_ord_ore", Indexes: []string{"ore"}, Query: "BigintOrdOreQuery", QuerySQLDomain: "eql_v3.query_bigint_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "BigintOrd", GoName: "BigintOrd", Family: "bigint", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v3_bigint_ord", Indexes: []string{"ope"}, Query: "BigintOrdQuery", QuerySQLDomain: "eql_v3.query_bigint_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "BigintOrdOpe", GoName: "BigintOrdOpe", Family: "bigint", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v3_bigint_ord_ope", Indexes: []string{"ope"}, Query: "BigintOrdOpeQuery", QuerySQLDomain: "eql_v3.query_bigint_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "Date", GoName: "Date", Family: "date", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_date", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "DateEq", GoName: "DateEq", Family: "date", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v3_date_eq", Indexes: []string{"eq"}, Query: "DateEqQuery", QuerySQLDomain: "eql_v3.query_date_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "DateOrdOre", GoName: "DateOrdOre", Family: "date", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v3_date_ord_ore", Indexes: []string{"ore"}, Query: "DateOrdOreQuery", QuerySQLDomain: "eql_v3.query_date_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "DateOrd", GoName: "DateOrd", Family: "date", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v3_date_ord", Indexes: []string{"ope"}, Query: "DateOrdQuery", QuerySQLDomain: "eql_v3.query_date_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "DateOrdOpe", GoName: "DateOrdOpe", Family: "date", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v3_date_ord_ope", Indexes: []string{"ope"}, Query: "DateOrdOpeQuery", QuerySQLDomain: "eql_v3.query_date_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "Timestamp", GoName: "Timestamp", Family: "timestamp", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_timestamp", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "TimestampEq", GoName: "TimestampEq", Family: "timestamp", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v3_timestamp_eq", Indexes: []string{"eq"}, Query: "TimestampEqQuery", QuerySQLDomain: "eql_v3.query_timestamp_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "TimestampOrdOre", GoName: "TimestampOrdOre", Family: "timestamp", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v3_timestamp_ord_ore", Indexes: []string{"ore"}, Query: "TimestampOrdOreQuery", QuerySQLDomain: "eql_v3.query_timestamp_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "TimestampOrd", GoName: "TimestampOrd", Family: "timestamp", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v3_timestamp_ord", Indexes: []string{"ope"}, Query: "TimestampOrdQuery", QuerySQLDomain: "eql_v3.query_timestamp_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "TimestampOrdOpe", GoName: "TimestampOrdOpe", Family: "timestamp", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v3_timestamp_ord_ope", Indexes: []string{"ope"}, Query: "TimestampOrdOpeQuery", QuerySQLDomain: "eql_v3.query_timestamp_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "Numeric", GoName: "Numeric", Family: "numeric", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_numeric", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "NumericEq", GoName: "NumericEq", Family: "numeric", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v3_numeric_eq", Indexes: []string{"eq"}, Query: "NumericEqQuery", QuerySQLDomain: "eql_v3.query_numeric_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "NumericOrdOre", GoName: "NumericOrdOre", Family: "numeric", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v3_numeric_ord_ore", Indexes: []string{"ore"}, Query: "NumericOrdOreQuery", QuerySQLDomain: "eql_v3.query_numeric_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "NumericOrd", GoName: "NumericOrd", Family: "numeric", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v3_numeric_ord", Indexes: []string{"ope"}, Query: "NumericOrdQuery", QuerySQLDomain: "eql_v3.query_numeric_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "NumericOrdOpe", GoName: "NumericOrdOpe", Family: "numeric", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v3_numeric_ord_ope", Indexes: []string{"ope"}, Query: "NumericOrdOpeQuery", QuerySQLDomain: "eql_v3.query_numeric_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "Text", GoName: "Text", Family: "text", Suffix: "", Plaintext: "string", SQLDomain: "public.eql_v3_text", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "the storage-only text domain follows once TextEq is proven end to end in PostgreSQL"}, - {Name: "TextEq", GoName: "TextEq", Family: "text", Suffix: "Eq", Plaintext: "string", SQLDomain: "public.eql_v3_text_eq", Indexes: []string{"eq"}, Query: "TextEqQuery", QuerySQLDomain: "eql_v3.query_text_eq", Producible: true, Reason: ""}, - {Name: "TextMatch", GoName: "TextMatch", Family: "text", Suffix: "Match", Plaintext: "string", SQLDomain: "public.eql_v3_text_match", Indexes: []string{"match"}, Query: "TextMatchQuery", QuerySQLDomain: "eql_v3.query_text_match", Producible: false, Reason: "the engine derives match and OPE terms, but no EQL type is built from them yet"}, - {Name: "TextOrdOre", GoName: "TextOrdOre", Family: "text", Suffix: "OrdOre", Plaintext: "string", SQLDomain: "public.eql_v3_text_ord_ore", Indexes: []string{"eq", "ore"}, Query: "TextOrdOreQuery", QuerySQLDomain: "eql_v3.query_text_ord_ore", Producible: false, Reason: "EQL stores a block ORE term and the engine derives a CLLW ORE term; the two are different algorithms"}, - {Name: "TextOrd", GoName: "TextOrd", Family: "text", Suffix: "Ord", Plaintext: "string", SQLDomain: "public.eql_v3_text_ord", Indexes: []string{"eq", "ope"}, Query: "TextOrdQuery", QuerySQLDomain: "eql_v3.query_text_ord", Producible: false, Reason: "the engine derives match and OPE terms, but no EQL type is built from them yet"}, - {Name: "TextOrdOpe", GoName: "TextOrdOpe", Family: "text", Suffix: "OrdOpe", Plaintext: "string", SQLDomain: "public.eql_v3_text_ord_ope", Indexes: []string{"eq", "ope"}, Query: "TextOrdOpeQuery", QuerySQLDomain: "eql_v3.query_text_ord_ope", Producible: false, Reason: "the engine derives match and OPE terms, but no EQL type is built from them yet"}, - {Name: "TextSearchOre", GoName: "TextSearchOre", Family: "text", Suffix: "SearchOre", Plaintext: "string", SQLDomain: "public.eql_v3_text_search_ore", Indexes: []string{"eq", "ore", "match"}, Query: "TextSearchOreQuery", QuerySQLDomain: "eql_v3.query_text_search_ore", Producible: false, Reason: "EQL stores a block ORE term and the engine derives a CLLW ORE term; the two are different algorithms"}, - {Name: "TextSearch", GoName: "TextSearch", Family: "text", Suffix: "Search", Plaintext: "string", SQLDomain: "public.eql_v3_text_search", Indexes: []string{"eq", "ope", "match"}, Query: "TextSearchQuery", QuerySQLDomain: "eql_v3.query_text_search", Producible: false, Reason: "the engine derives match and OPE terms, but no EQL type is built from them yet"}, - {Name: "Boolean", GoName: "Boolean", Family: "boolean", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_boolean", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "Real", GoName: "Real", Family: "real", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_real", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "RealEq", GoName: "RealEq", Family: "real", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v3_real_eq", Indexes: []string{"eq"}, Query: "RealEqQuery", QuerySQLDomain: "eql_v3.query_real_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "RealOrdOre", GoName: "RealOrdOre", Family: "real", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v3_real_ord_ore", Indexes: []string{"ore"}, Query: "RealOrdOreQuery", QuerySQLDomain: "eql_v3.query_real_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "RealOrd", GoName: "RealOrd", Family: "real", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v3_real_ord", Indexes: []string{"ope"}, Query: "RealOrdQuery", QuerySQLDomain: "eql_v3.query_real_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "RealOrdOpe", GoName: "RealOrdOpe", Family: "real", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v3_real_ord_ope", Indexes: []string{"ope"}, Query: "RealOrdOpeQuery", QuerySQLDomain: "eql_v3.query_real_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "Double", GoName: "Double", Family: "double", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_double", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "DoubleEq", GoName: "DoubleEq", Family: "double", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v3_double_eq", Indexes: []string{"eq"}, Query: "DoubleEqQuery", QuerySQLDomain: "eql_v3.query_double_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "DoubleOrdOre", GoName: "DoubleOrdOre", Family: "double", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v3_double_ord_ore", Indexes: []string{"ore"}, Query: "DoubleOrdOreQuery", QuerySQLDomain: "eql_v3.query_double_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "DoubleOrd", GoName: "DoubleOrd", Family: "double", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v3_double_ord", Indexes: []string{"ope"}, Query: "DoubleOrdQuery", QuerySQLDomain: "eql_v3.query_double_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "DoubleOrdOpe", GoName: "DoubleOrdOpe", Family: "double", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v3_double_ord_ope", Indexes: []string{"ope"}, Query: "DoubleOrdOpeQuery", QuerySQLDomain: "eql_v3.query_double_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, - {Name: "SteVecDocument", GoName: "SteVecDocument", Family: "json", Suffix: "Search", Plaintext: "", SQLDomain: "public.eql_v3_json_search", Indexes: []string{"json"}, Query: "SteVecQuery", QuerySQLDomain: "eql_v3.query_json", Producible: false, Reason: "the JSON index is a new operation in the engine"}, - {Name: "Json", GoName: "JSON", Family: "json", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v3_json", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, -} - -// Integer is the EQL type stored in public.eql_v3_integer: the integer family with no index. + {Name: "Integer", GoName: "Integer", Family: "integer", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v4_integer", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "IntegerEq", GoName: "IntegerEq", Family: "integer", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v4_integer_eq", Indexes: []string{"eq"}, Query: "IntegerEqQuery", QuerySQLDomain: "eql_v4.query_integer_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "IntegerOrdOre", GoName: "IntegerOrdOre", Family: "integer", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v4_integer_ord_ore", Indexes: []string{"ore"}, Query: "IntegerOrdOreQuery", QuerySQLDomain: "eql_v4.query_integer_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "IntegerOrd", GoName: "IntegerOrd", Family: "integer", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v4_integer_ord", Indexes: []string{"ope"}, Query: "IntegerOrdQuery", QuerySQLDomain: "eql_v4.query_integer_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "IntegerOrdOpe", GoName: "IntegerOrdOpe", Family: "integer", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v4_integer_ord_ope", Indexes: []string{"ope"}, Query: "IntegerOrdOpeQuery", QuerySQLDomain: "eql_v4.query_integer_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "Smallint", GoName: "Smallint", Family: "smallint", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v4_smallint", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "SmallintEq", GoName: "SmallintEq", Family: "smallint", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v4_smallint_eq", Indexes: []string{"eq"}, Query: "SmallintEqQuery", QuerySQLDomain: "eql_v4.query_smallint_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "SmallintOrdOre", GoName: "SmallintOrdOre", Family: "smallint", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v4_smallint_ord_ore", Indexes: []string{"ore"}, Query: "SmallintOrdOreQuery", QuerySQLDomain: "eql_v4.query_smallint_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "SmallintOrd", GoName: "SmallintOrd", Family: "smallint", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v4_smallint_ord", Indexes: []string{"ope"}, Query: "SmallintOrdQuery", QuerySQLDomain: "eql_v4.query_smallint_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "SmallintOrdOpe", GoName: "SmallintOrdOpe", Family: "smallint", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v4_smallint_ord_ope", Indexes: []string{"ope"}, Query: "SmallintOrdOpeQuery", QuerySQLDomain: "eql_v4.query_smallint_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "Bigint", GoName: "Bigint", Family: "bigint", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v4_bigint", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "BigintEq", GoName: "BigintEq", Family: "bigint", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v4_bigint_eq", Indexes: []string{"eq"}, Query: "BigintEqQuery", QuerySQLDomain: "eql_v4.query_bigint_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "BigintOrdOre", GoName: "BigintOrdOre", Family: "bigint", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v4_bigint_ord_ore", Indexes: []string{"ore"}, Query: "BigintOrdOreQuery", QuerySQLDomain: "eql_v4.query_bigint_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "BigintOrd", GoName: "BigintOrd", Family: "bigint", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v4_bigint_ord", Indexes: []string{"ope"}, Query: "BigintOrdQuery", QuerySQLDomain: "eql_v4.query_bigint_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "BigintOrdOpe", GoName: "BigintOrdOpe", Family: "bigint", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v4_bigint_ord_ope", Indexes: []string{"ope"}, Query: "BigintOrdOpeQuery", QuerySQLDomain: "eql_v4.query_bigint_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "Date", GoName: "Date", Family: "date", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v4_date", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "DateEq", GoName: "DateEq", Family: "date", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v4_date_eq", Indexes: []string{"eq"}, Query: "DateEqQuery", QuerySQLDomain: "eql_v4.query_date_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "DateOrdOre", GoName: "DateOrdOre", Family: "date", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v4_date_ord_ore", Indexes: []string{"ore"}, Query: "DateOrdOreQuery", QuerySQLDomain: "eql_v4.query_date_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "DateOrd", GoName: "DateOrd", Family: "date", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v4_date_ord", Indexes: []string{"ope"}, Query: "DateOrdQuery", QuerySQLDomain: "eql_v4.query_date_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "DateOrdOpe", GoName: "DateOrdOpe", Family: "date", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v4_date_ord_ope", Indexes: []string{"ope"}, Query: "DateOrdOpeQuery", QuerySQLDomain: "eql_v4.query_date_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "Timestamp", GoName: "Timestamp", Family: "timestamp", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v4_timestamp", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "TimestampEq", GoName: "TimestampEq", Family: "timestamp", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v4_timestamp_eq", Indexes: []string{"eq"}, Query: "TimestampEqQuery", QuerySQLDomain: "eql_v4.query_timestamp_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "TimestampOrdOre", GoName: "TimestampOrdOre", Family: "timestamp", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v4_timestamp_ord_ore", Indexes: []string{"ore"}, Query: "TimestampOrdOreQuery", QuerySQLDomain: "eql_v4.query_timestamp_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "TimestampOrd", GoName: "TimestampOrd", Family: "timestamp", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v4_timestamp_ord", Indexes: []string{"ope"}, Query: "TimestampOrdQuery", QuerySQLDomain: "eql_v4.query_timestamp_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "TimestampOrdOpe", GoName: "TimestampOrdOpe", Family: "timestamp", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v4_timestamp_ord_ope", Indexes: []string{"ope"}, Query: "TimestampOrdOpeQuery", QuerySQLDomain: "eql_v4.query_timestamp_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "Numeric", GoName: "Numeric", Family: "numeric", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v4_numeric", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "NumericEq", GoName: "NumericEq", Family: "numeric", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v4_numeric_eq", Indexes: []string{"eq"}, Query: "NumericEqQuery", QuerySQLDomain: "eql_v4.query_numeric_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "NumericOrdOre", GoName: "NumericOrdOre", Family: "numeric", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v4_numeric_ord_ore", Indexes: []string{"ore"}, Query: "NumericOrdOreQuery", QuerySQLDomain: "eql_v4.query_numeric_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "NumericOrd", GoName: "NumericOrd", Family: "numeric", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v4_numeric_ord", Indexes: []string{"ope"}, Query: "NumericOrdQuery", QuerySQLDomain: "eql_v4.query_numeric_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "NumericOrdOpe", GoName: "NumericOrdOpe", Family: "numeric", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v4_numeric_ord_ope", Indexes: []string{"ope"}, Query: "NumericOrdOpeQuery", QuerySQLDomain: "eql_v4.query_numeric_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "Text", GoName: "Text", Family: "text", Suffix: "", Plaintext: "string", SQLDomain: "public.eql_v4_text", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "the storage-only text domain follows once TextEq is proven end to end in PostgreSQL"}, + {Name: "TextEq", GoName: "TextEq", Family: "text", Suffix: "Eq", Plaintext: "string", SQLDomain: "public.eql_v4_text_eq", Indexes: []string{"eq"}, Query: "TextEqQuery", QuerySQLDomain: "eql_v4.query_text_eq", Producible: true, Reason: ""}, + {Name: "TextMatch", GoName: "TextMatch", Family: "text", Suffix: "Match", Plaintext: "string", SQLDomain: "public.eql_v4_text_match", Indexes: []string{"match"}, Query: "TextMatchQuery", QuerySQLDomain: "eql_v4.query_text_match", Producible: false, Reason: "the engine derives match and OPE terms, but no EQL type is built from them yet"}, + {Name: "TextOrdOre", GoName: "TextOrdOre", Family: "text", Suffix: "OrdOre", Plaintext: "string", SQLDomain: "public.eql_v4_text_ord_ore", Indexes: []string{"eq", "ore"}, Query: "TextOrdOreQuery", QuerySQLDomain: "eql_v4.query_text_ord_ore", Producible: false, Reason: "EQL stores a block ORE term and the engine derives a CLLW ORE term; the two are different algorithms"}, + {Name: "TextOrd", GoName: "TextOrd", Family: "text", Suffix: "Ord", Plaintext: "string", SQLDomain: "public.eql_v4_text_ord", Indexes: []string{"eq", "ope"}, Query: "TextOrdQuery", QuerySQLDomain: "eql_v4.query_text_ord", Producible: false, Reason: "the engine derives match and OPE terms, but no EQL type is built from them yet"}, + {Name: "TextOrdOpe", GoName: "TextOrdOpe", Family: "text", Suffix: "OrdOpe", Plaintext: "string", SQLDomain: "public.eql_v4_text_ord_ope", Indexes: []string{"eq", "ope"}, Query: "TextOrdOpeQuery", QuerySQLDomain: "eql_v4.query_text_ord_ope", Producible: false, Reason: "the engine derives match and OPE terms, but no EQL type is built from them yet"}, + {Name: "TextSearchOre", GoName: "TextSearchOre", Family: "text", Suffix: "SearchOre", Plaintext: "string", SQLDomain: "public.eql_v4_text_search_ore", Indexes: []string{"eq", "ore", "match"}, Query: "TextSearchOreQuery", QuerySQLDomain: "eql_v4.query_text_search_ore", Producible: false, Reason: "EQL stores a block ORE term and the engine derives a CLLW ORE term; the two are different algorithms"}, + {Name: "TextSearch", GoName: "TextSearch", Family: "text", Suffix: "Search", Plaintext: "string", SQLDomain: "public.eql_v4_text_search", Indexes: []string{"eq", "ope", "match"}, Query: "TextSearchQuery", QuerySQLDomain: "eql_v4.query_text_search", Producible: false, Reason: "the engine derives match and OPE terms, but no EQL type is built from them yet"}, + {Name: "Boolean", GoName: "Boolean", Family: "boolean", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v4_boolean", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "Real", GoName: "Real", Family: "real", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v4_real", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "RealEq", GoName: "RealEq", Family: "real", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v4_real_eq", Indexes: []string{"eq"}, Query: "RealEqQuery", QuerySQLDomain: "eql_v4.query_real_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "RealOrdOre", GoName: "RealOrdOre", Family: "real", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v4_real_ord_ore", Indexes: []string{"ore"}, Query: "RealOrdOreQuery", QuerySQLDomain: "eql_v4.query_real_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "RealOrd", GoName: "RealOrd", Family: "real", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v4_real_ord", Indexes: []string{"ope"}, Query: "RealOrdQuery", QuerySQLDomain: "eql_v4.query_real_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "RealOrdOpe", GoName: "RealOrdOpe", Family: "real", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v4_real_ord_ope", Indexes: []string{"ope"}, Query: "RealOrdOpeQuery", QuerySQLDomain: "eql_v4.query_real_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "Double", GoName: "Double", Family: "double", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v4_double", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "DoubleEq", GoName: "DoubleEq", Family: "double", Suffix: "Eq", Plaintext: "", SQLDomain: "public.eql_v4_double_eq", Indexes: []string{"eq"}, Query: "DoubleEqQuery", QuerySQLDomain: "eql_v4.query_double_eq", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "DoubleOrdOre", GoName: "DoubleOrdOre", Family: "double", Suffix: "OrdOre", Plaintext: "", SQLDomain: "public.eql_v4_double_ord_ore", Indexes: []string{"ore"}, Query: "DoubleOrdOreQuery", QuerySQLDomain: "eql_v4.query_double_ord_ore", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "DoubleOrd", GoName: "DoubleOrd", Family: "double", Suffix: "Ord", Plaintext: "", SQLDomain: "public.eql_v4_double_ord", Indexes: []string{"ope"}, Query: "DoubleOrdQuery", QuerySQLDomain: "eql_v4.query_double_ord", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "DoubleOrdOpe", GoName: "DoubleOrdOpe", Family: "double", Suffix: "OrdOpe", Plaintext: "", SQLDomain: "public.eql_v4_double_ord_ope", Indexes: []string{"ope"}, Query: "DoubleOrdOpeQuery", QuerySQLDomain: "eql_v4.query_double_ord_ope", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, + {Name: "SteVecDocument", GoName: "SteVecDocument", Family: "json", Suffix: "Search", Plaintext: "", SQLDomain: "public.eql_v4_json_search", Indexes: []string{"json"}, Query: "SteVecQuery", QuerySQLDomain: "eql_v4.query_json", Producible: false, Reason: "the JSON index is a new operation in the engine"}, + {Name: "Json", GoName: "JSON", Family: "json", Suffix: "", Plaintext: "", SQLDomain: "public.eql_v4_json", Indexes: nil, Query: "", QuerySQLDomain: "", Producible: false, Reason: "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is"}, +} + +// Integer is the EQL type stored in public.eql_v4_integer: the integer family with no index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type Integer []byte @@ -71,7 +71,7 @@ func (v Integer) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_integer column. +// Scan reads a public.eql_v4_integer column. func (v *Integer) Scan(src any) error { return scan((*[]byte)(v), src, "Integer") } @@ -86,7 +86,7 @@ func (v *Integer) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// IntegerEq is the EQL type stored in public.eql_v3_integer_eq: the integer family with the eq index. +// IntegerEq is the EQL type stored in public.eql_v4_integer_eq: the integer family with the eq index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type IntegerEq []byte @@ -95,7 +95,7 @@ func (v IntegerEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_integer_eq column. +// Scan reads a public.eql_v4_integer_eq column. func (v *IntegerEq) Scan(src any) error { return scan((*[]byte)(v), src, "IntegerEq") } @@ -110,7 +110,7 @@ func (v *IntegerEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// IntegerEqQuery is the query value for IntegerEq: the operand eql_v3.query_integer_eq takes. +// IntegerEqQuery is the query value for IntegerEq: the operand eql_v4.query_integer_eq takes. type IntegerEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -118,7 +118,7 @@ func (v IntegerEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_integer_eq column. +// Scan reads a eql_v4.query_integer_eq column. func (v *IntegerEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "IntegerEqQuery") } @@ -133,7 +133,7 @@ func (v *IntegerEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// IntegerOrdOre is the EQL type stored in public.eql_v3_integer_ord_ore: the integer family with the ore index. +// IntegerOrdOre is the EQL type stored in public.eql_v4_integer_ord_ore: the integer family with the ore index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type IntegerOrdOre []byte @@ -142,7 +142,7 @@ func (v IntegerOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_integer_ord_ore column. +// Scan reads a public.eql_v4_integer_ord_ore column. func (v *IntegerOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "IntegerOrdOre") } @@ -157,7 +157,7 @@ func (v *IntegerOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// IntegerOrdOreQuery is the query value for IntegerOrdOre: the operand eql_v3.query_integer_ord_ore takes. +// IntegerOrdOreQuery is the query value for IntegerOrdOre: the operand eql_v4.query_integer_ord_ore takes. type IntegerOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -165,7 +165,7 @@ func (v IntegerOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_integer_ord_ore column. +// Scan reads a eql_v4.query_integer_ord_ore column. func (v *IntegerOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "IntegerOrdOreQuery") } @@ -180,7 +180,7 @@ func (v *IntegerOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// IntegerOrd is the EQL type stored in public.eql_v3_integer_ord: the integer family with the ope index. +// IntegerOrd is the EQL type stored in public.eql_v4_integer_ord: the integer family with the ope index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type IntegerOrd []byte @@ -189,7 +189,7 @@ func (v IntegerOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_integer_ord column. +// Scan reads a public.eql_v4_integer_ord column. func (v *IntegerOrd) Scan(src any) error { return scan((*[]byte)(v), src, "IntegerOrd") } @@ -204,7 +204,7 @@ func (v *IntegerOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// IntegerOrdQuery is the query value for IntegerOrd: the operand eql_v3.query_integer_ord takes. +// IntegerOrdQuery is the query value for IntegerOrd: the operand eql_v4.query_integer_ord takes. type IntegerOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -212,7 +212,7 @@ func (v IntegerOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_integer_ord column. +// Scan reads a eql_v4.query_integer_ord column. func (v *IntegerOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "IntegerOrdQuery") } @@ -227,7 +227,7 @@ func (v *IntegerOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// IntegerOrdOpe is the EQL type stored in public.eql_v3_integer_ord_ope: the integer family with the ope index. +// IntegerOrdOpe is the EQL type stored in public.eql_v4_integer_ord_ope: the integer family with the ope index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type IntegerOrdOpe []byte @@ -236,7 +236,7 @@ func (v IntegerOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_integer_ord_ope column. +// Scan reads a public.eql_v4_integer_ord_ope column. func (v *IntegerOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "IntegerOrdOpe") } @@ -251,7 +251,7 @@ func (v *IntegerOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// IntegerOrdOpeQuery is the query value for IntegerOrdOpe: the operand eql_v3.query_integer_ord_ope takes. +// IntegerOrdOpeQuery is the query value for IntegerOrdOpe: the operand eql_v4.query_integer_ord_ope takes. type IntegerOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -259,7 +259,7 @@ func (v IntegerOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_integer_ord_ope column. +// Scan reads a eql_v4.query_integer_ord_ope column. func (v *IntegerOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "IntegerOrdOpeQuery") } @@ -274,7 +274,7 @@ func (v *IntegerOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Smallint is the EQL type stored in public.eql_v3_smallint: the smallint family with no index. +// Smallint is the EQL type stored in public.eql_v4_smallint: the smallint family with no index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type Smallint []byte @@ -283,7 +283,7 @@ func (v Smallint) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_smallint column. +// Scan reads a public.eql_v4_smallint column. func (v *Smallint) Scan(src any) error { return scan((*[]byte)(v), src, "Smallint") } @@ -298,7 +298,7 @@ func (v *Smallint) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SmallintEq is the EQL type stored in public.eql_v3_smallint_eq: the smallint family with the eq index. +// SmallintEq is the EQL type stored in public.eql_v4_smallint_eq: the smallint family with the eq index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type SmallintEq []byte @@ -307,7 +307,7 @@ func (v SmallintEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_smallint_eq column. +// Scan reads a public.eql_v4_smallint_eq column. func (v *SmallintEq) Scan(src any) error { return scan((*[]byte)(v), src, "SmallintEq") } @@ -322,7 +322,7 @@ func (v *SmallintEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SmallintEqQuery is the query value for SmallintEq: the operand eql_v3.query_smallint_eq takes. +// SmallintEqQuery is the query value for SmallintEq: the operand eql_v4.query_smallint_eq takes. type SmallintEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -330,7 +330,7 @@ func (v SmallintEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_smallint_eq column. +// Scan reads a eql_v4.query_smallint_eq column. func (v *SmallintEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "SmallintEqQuery") } @@ -345,7 +345,7 @@ func (v *SmallintEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SmallintOrdOre is the EQL type stored in public.eql_v3_smallint_ord_ore: the smallint family with the ore index. +// SmallintOrdOre is the EQL type stored in public.eql_v4_smallint_ord_ore: the smallint family with the ore index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type SmallintOrdOre []byte @@ -354,7 +354,7 @@ func (v SmallintOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_smallint_ord_ore column. +// Scan reads a public.eql_v4_smallint_ord_ore column. func (v *SmallintOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "SmallintOrdOre") } @@ -369,7 +369,7 @@ func (v *SmallintOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SmallintOrdOreQuery is the query value for SmallintOrdOre: the operand eql_v3.query_smallint_ord_ore takes. +// SmallintOrdOreQuery is the query value for SmallintOrdOre: the operand eql_v4.query_smallint_ord_ore takes. type SmallintOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -377,7 +377,7 @@ func (v SmallintOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_smallint_ord_ore column. +// Scan reads a eql_v4.query_smallint_ord_ore column. func (v *SmallintOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "SmallintOrdOreQuery") } @@ -392,7 +392,7 @@ func (v *SmallintOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SmallintOrd is the EQL type stored in public.eql_v3_smallint_ord: the smallint family with the ope index. +// SmallintOrd is the EQL type stored in public.eql_v4_smallint_ord: the smallint family with the ope index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type SmallintOrd []byte @@ -401,7 +401,7 @@ func (v SmallintOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_smallint_ord column. +// Scan reads a public.eql_v4_smallint_ord column. func (v *SmallintOrd) Scan(src any) error { return scan((*[]byte)(v), src, "SmallintOrd") } @@ -416,7 +416,7 @@ func (v *SmallintOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SmallintOrdQuery is the query value for SmallintOrd: the operand eql_v3.query_smallint_ord takes. +// SmallintOrdQuery is the query value for SmallintOrd: the operand eql_v4.query_smallint_ord takes. type SmallintOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -424,7 +424,7 @@ func (v SmallintOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_smallint_ord column. +// Scan reads a eql_v4.query_smallint_ord column. func (v *SmallintOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "SmallintOrdQuery") } @@ -439,7 +439,7 @@ func (v *SmallintOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SmallintOrdOpe is the EQL type stored in public.eql_v3_smallint_ord_ope: the smallint family with the ope index. +// SmallintOrdOpe is the EQL type stored in public.eql_v4_smallint_ord_ope: the smallint family with the ope index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type SmallintOrdOpe []byte @@ -448,7 +448,7 @@ func (v SmallintOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_smallint_ord_ope column. +// Scan reads a public.eql_v4_smallint_ord_ope column. func (v *SmallintOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "SmallintOrdOpe") } @@ -463,7 +463,7 @@ func (v *SmallintOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SmallintOrdOpeQuery is the query value for SmallintOrdOpe: the operand eql_v3.query_smallint_ord_ope takes. +// SmallintOrdOpeQuery is the query value for SmallintOrdOpe: the operand eql_v4.query_smallint_ord_ope takes. type SmallintOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -471,7 +471,7 @@ func (v SmallintOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_smallint_ord_ope column. +// Scan reads a eql_v4.query_smallint_ord_ope column. func (v *SmallintOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "SmallintOrdOpeQuery") } @@ -486,7 +486,7 @@ func (v *SmallintOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Bigint is the EQL type stored in public.eql_v3_bigint: the bigint family with no index. +// Bigint is the EQL type stored in public.eql_v4_bigint: the bigint family with no index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type Bigint []byte @@ -495,7 +495,7 @@ func (v Bigint) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_bigint column. +// Scan reads a public.eql_v4_bigint column. func (v *Bigint) Scan(src any) error { return scan((*[]byte)(v), src, "Bigint") } @@ -510,7 +510,7 @@ func (v *Bigint) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// BigintEq is the EQL type stored in public.eql_v3_bigint_eq: the bigint family with the eq index. +// BigintEq is the EQL type stored in public.eql_v4_bigint_eq: the bigint family with the eq index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type BigintEq []byte @@ -519,7 +519,7 @@ func (v BigintEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_bigint_eq column. +// Scan reads a public.eql_v4_bigint_eq column. func (v *BigintEq) Scan(src any) error { return scan((*[]byte)(v), src, "BigintEq") } @@ -534,7 +534,7 @@ func (v *BigintEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// BigintEqQuery is the query value for BigintEq: the operand eql_v3.query_bigint_eq takes. +// BigintEqQuery is the query value for BigintEq: the operand eql_v4.query_bigint_eq takes. type BigintEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -542,7 +542,7 @@ func (v BigintEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_bigint_eq column. +// Scan reads a eql_v4.query_bigint_eq column. func (v *BigintEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "BigintEqQuery") } @@ -557,7 +557,7 @@ func (v *BigintEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// BigintOrdOre is the EQL type stored in public.eql_v3_bigint_ord_ore: the bigint family with the ore index. +// BigintOrdOre is the EQL type stored in public.eql_v4_bigint_ord_ore: the bigint family with the ore index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type BigintOrdOre []byte @@ -566,7 +566,7 @@ func (v BigintOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_bigint_ord_ore column. +// Scan reads a public.eql_v4_bigint_ord_ore column. func (v *BigintOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "BigintOrdOre") } @@ -581,7 +581,7 @@ func (v *BigintOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// BigintOrdOreQuery is the query value for BigintOrdOre: the operand eql_v3.query_bigint_ord_ore takes. +// BigintOrdOreQuery is the query value for BigintOrdOre: the operand eql_v4.query_bigint_ord_ore takes. type BigintOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -589,7 +589,7 @@ func (v BigintOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_bigint_ord_ore column. +// Scan reads a eql_v4.query_bigint_ord_ore column. func (v *BigintOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "BigintOrdOreQuery") } @@ -604,7 +604,7 @@ func (v *BigintOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// BigintOrd is the EQL type stored in public.eql_v3_bigint_ord: the bigint family with the ope index. +// BigintOrd is the EQL type stored in public.eql_v4_bigint_ord: the bigint family with the ope index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type BigintOrd []byte @@ -613,7 +613,7 @@ func (v BigintOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_bigint_ord column. +// Scan reads a public.eql_v4_bigint_ord column. func (v *BigintOrd) Scan(src any) error { return scan((*[]byte)(v), src, "BigintOrd") } @@ -628,7 +628,7 @@ func (v *BigintOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// BigintOrdQuery is the query value for BigintOrd: the operand eql_v3.query_bigint_ord takes. +// BigintOrdQuery is the query value for BigintOrd: the operand eql_v4.query_bigint_ord takes. type BigintOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -636,7 +636,7 @@ func (v BigintOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_bigint_ord column. +// Scan reads a eql_v4.query_bigint_ord column. func (v *BigintOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "BigintOrdQuery") } @@ -651,7 +651,7 @@ func (v *BigintOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// BigintOrdOpe is the EQL type stored in public.eql_v3_bigint_ord_ope: the bigint family with the ope index. +// BigintOrdOpe is the EQL type stored in public.eql_v4_bigint_ord_ope: the bigint family with the ope index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type BigintOrdOpe []byte @@ -660,7 +660,7 @@ func (v BigintOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_bigint_ord_ope column. +// Scan reads a public.eql_v4_bigint_ord_ope column. func (v *BigintOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "BigintOrdOpe") } @@ -675,7 +675,7 @@ func (v *BigintOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// BigintOrdOpeQuery is the query value for BigintOrdOpe: the operand eql_v3.query_bigint_ord_ope takes. +// BigintOrdOpeQuery is the query value for BigintOrdOpe: the operand eql_v4.query_bigint_ord_ope takes. type BigintOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -683,7 +683,7 @@ func (v BigintOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_bigint_ord_ope column. +// Scan reads a eql_v4.query_bigint_ord_ope column. func (v *BigintOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "BigintOrdOpeQuery") } @@ -698,7 +698,7 @@ func (v *BigintOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Date is the EQL type stored in public.eql_v3_date: the date family with no index. +// Date is the EQL type stored in public.eql_v4_date: the date family with no index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type Date []byte @@ -707,7 +707,7 @@ func (v Date) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_date column. +// Scan reads a public.eql_v4_date column. func (v *Date) Scan(src any) error { return scan((*[]byte)(v), src, "Date") } @@ -722,7 +722,7 @@ func (v *Date) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DateEq is the EQL type stored in public.eql_v3_date_eq: the date family with the eq index. +// DateEq is the EQL type stored in public.eql_v4_date_eq: the date family with the eq index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type DateEq []byte @@ -731,7 +731,7 @@ func (v DateEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_date_eq column. +// Scan reads a public.eql_v4_date_eq column. func (v *DateEq) Scan(src any) error { return scan((*[]byte)(v), src, "DateEq") } @@ -746,7 +746,7 @@ func (v *DateEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DateEqQuery is the query value for DateEq: the operand eql_v3.query_date_eq takes. +// DateEqQuery is the query value for DateEq: the operand eql_v4.query_date_eq takes. type DateEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -754,7 +754,7 @@ func (v DateEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_date_eq column. +// Scan reads a eql_v4.query_date_eq column. func (v *DateEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "DateEqQuery") } @@ -769,7 +769,7 @@ func (v *DateEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DateOrdOre is the EQL type stored in public.eql_v3_date_ord_ore: the date family with the ore index. +// DateOrdOre is the EQL type stored in public.eql_v4_date_ord_ore: the date family with the ore index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type DateOrdOre []byte @@ -778,7 +778,7 @@ func (v DateOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_date_ord_ore column. +// Scan reads a public.eql_v4_date_ord_ore column. func (v *DateOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "DateOrdOre") } @@ -793,7 +793,7 @@ func (v *DateOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DateOrdOreQuery is the query value for DateOrdOre: the operand eql_v3.query_date_ord_ore takes. +// DateOrdOreQuery is the query value for DateOrdOre: the operand eql_v4.query_date_ord_ore takes. type DateOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -801,7 +801,7 @@ func (v DateOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_date_ord_ore column. +// Scan reads a eql_v4.query_date_ord_ore column. func (v *DateOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "DateOrdOreQuery") } @@ -816,7 +816,7 @@ func (v *DateOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DateOrd is the EQL type stored in public.eql_v3_date_ord: the date family with the ope index. +// DateOrd is the EQL type stored in public.eql_v4_date_ord: the date family with the ope index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type DateOrd []byte @@ -825,7 +825,7 @@ func (v DateOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_date_ord column. +// Scan reads a public.eql_v4_date_ord column. func (v *DateOrd) Scan(src any) error { return scan((*[]byte)(v), src, "DateOrd") } @@ -840,7 +840,7 @@ func (v *DateOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DateOrdQuery is the query value for DateOrd: the operand eql_v3.query_date_ord takes. +// DateOrdQuery is the query value for DateOrd: the operand eql_v4.query_date_ord takes. type DateOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -848,7 +848,7 @@ func (v DateOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_date_ord column. +// Scan reads a eql_v4.query_date_ord column. func (v *DateOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "DateOrdQuery") } @@ -863,7 +863,7 @@ func (v *DateOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DateOrdOpe is the EQL type stored in public.eql_v3_date_ord_ope: the date family with the ope index. +// DateOrdOpe is the EQL type stored in public.eql_v4_date_ord_ope: the date family with the ope index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type DateOrdOpe []byte @@ -872,7 +872,7 @@ func (v DateOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_date_ord_ope column. +// Scan reads a public.eql_v4_date_ord_ope column. func (v *DateOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "DateOrdOpe") } @@ -887,7 +887,7 @@ func (v *DateOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DateOrdOpeQuery is the query value for DateOrdOpe: the operand eql_v3.query_date_ord_ope takes. +// DateOrdOpeQuery is the query value for DateOrdOpe: the operand eql_v4.query_date_ord_ope takes. type DateOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -895,7 +895,7 @@ func (v DateOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_date_ord_ope column. +// Scan reads a eql_v4.query_date_ord_ope column. func (v *DateOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "DateOrdOpeQuery") } @@ -910,7 +910,7 @@ func (v *DateOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Timestamp is the EQL type stored in public.eql_v3_timestamp: the timestamp family with no index. +// Timestamp is the EQL type stored in public.eql_v4_timestamp: the timestamp family with no index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type Timestamp []byte @@ -919,7 +919,7 @@ func (v Timestamp) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_timestamp column. +// Scan reads a public.eql_v4_timestamp column. func (v *Timestamp) Scan(src any) error { return scan((*[]byte)(v), src, "Timestamp") } @@ -934,7 +934,7 @@ func (v *Timestamp) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TimestampEq is the EQL type stored in public.eql_v3_timestamp_eq: the timestamp family with the eq index. +// TimestampEq is the EQL type stored in public.eql_v4_timestamp_eq: the timestamp family with the eq index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type TimestampEq []byte @@ -943,7 +943,7 @@ func (v TimestampEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_timestamp_eq column. +// Scan reads a public.eql_v4_timestamp_eq column. func (v *TimestampEq) Scan(src any) error { return scan((*[]byte)(v), src, "TimestampEq") } @@ -958,7 +958,7 @@ func (v *TimestampEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TimestampEqQuery is the query value for TimestampEq: the operand eql_v3.query_timestamp_eq takes. +// TimestampEqQuery is the query value for TimestampEq: the operand eql_v4.query_timestamp_eq takes. type TimestampEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -966,7 +966,7 @@ func (v TimestampEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_timestamp_eq column. +// Scan reads a eql_v4.query_timestamp_eq column. func (v *TimestampEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TimestampEqQuery") } @@ -981,7 +981,7 @@ func (v *TimestampEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TimestampOrdOre is the EQL type stored in public.eql_v3_timestamp_ord_ore: the timestamp family with the ore index. +// TimestampOrdOre is the EQL type stored in public.eql_v4_timestamp_ord_ore: the timestamp family with the ore index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type TimestampOrdOre []byte @@ -990,7 +990,7 @@ func (v TimestampOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_timestamp_ord_ore column. +// Scan reads a public.eql_v4_timestamp_ord_ore column. func (v *TimestampOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "TimestampOrdOre") } @@ -1005,7 +1005,7 @@ func (v *TimestampOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TimestampOrdOreQuery is the query value for TimestampOrdOre: the operand eql_v3.query_timestamp_ord_ore takes. +// TimestampOrdOreQuery is the query value for TimestampOrdOre: the operand eql_v4.query_timestamp_ord_ore takes. type TimestampOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1013,7 +1013,7 @@ func (v TimestampOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_timestamp_ord_ore column. +// Scan reads a eql_v4.query_timestamp_ord_ore column. func (v *TimestampOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TimestampOrdOreQuery") } @@ -1028,7 +1028,7 @@ func (v *TimestampOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TimestampOrd is the EQL type stored in public.eql_v3_timestamp_ord: the timestamp family with the ope index. +// TimestampOrd is the EQL type stored in public.eql_v4_timestamp_ord: the timestamp family with the ope index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type TimestampOrd []byte @@ -1037,7 +1037,7 @@ func (v TimestampOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_timestamp_ord column. +// Scan reads a public.eql_v4_timestamp_ord column. func (v *TimestampOrd) Scan(src any) error { return scan((*[]byte)(v), src, "TimestampOrd") } @@ -1052,7 +1052,7 @@ func (v *TimestampOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TimestampOrdQuery is the query value for TimestampOrd: the operand eql_v3.query_timestamp_ord takes. +// TimestampOrdQuery is the query value for TimestampOrd: the operand eql_v4.query_timestamp_ord takes. type TimestampOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1060,7 +1060,7 @@ func (v TimestampOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_timestamp_ord column. +// Scan reads a eql_v4.query_timestamp_ord column. func (v *TimestampOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TimestampOrdQuery") } @@ -1075,7 +1075,7 @@ func (v *TimestampOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TimestampOrdOpe is the EQL type stored in public.eql_v3_timestamp_ord_ope: the timestamp family with the ope index. +// TimestampOrdOpe is the EQL type stored in public.eql_v4_timestamp_ord_ope: the timestamp family with the ope index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type TimestampOrdOpe []byte @@ -1084,7 +1084,7 @@ func (v TimestampOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_timestamp_ord_ope column. +// Scan reads a public.eql_v4_timestamp_ord_ope column. func (v *TimestampOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "TimestampOrdOpe") } @@ -1099,7 +1099,7 @@ func (v *TimestampOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TimestampOrdOpeQuery is the query value for TimestampOrdOpe: the operand eql_v3.query_timestamp_ord_ope takes. +// TimestampOrdOpeQuery is the query value for TimestampOrdOpe: the operand eql_v4.query_timestamp_ord_ope takes. type TimestampOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1107,7 +1107,7 @@ func (v TimestampOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_timestamp_ord_ope column. +// Scan reads a eql_v4.query_timestamp_ord_ope column. func (v *TimestampOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TimestampOrdOpeQuery") } @@ -1122,7 +1122,7 @@ func (v *TimestampOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Numeric is the EQL type stored in public.eql_v3_numeric: the numeric family with no index. +// Numeric is the EQL type stored in public.eql_v4_numeric: the numeric family with no index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type Numeric []byte @@ -1131,7 +1131,7 @@ func (v Numeric) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_numeric column. +// Scan reads a public.eql_v4_numeric column. func (v *Numeric) Scan(src any) error { return scan((*[]byte)(v), src, "Numeric") } @@ -1146,7 +1146,7 @@ func (v *Numeric) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// NumericEq is the EQL type stored in public.eql_v3_numeric_eq: the numeric family with the eq index. +// NumericEq is the EQL type stored in public.eql_v4_numeric_eq: the numeric family with the eq index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type NumericEq []byte @@ -1155,7 +1155,7 @@ func (v NumericEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_numeric_eq column. +// Scan reads a public.eql_v4_numeric_eq column. func (v *NumericEq) Scan(src any) error { return scan((*[]byte)(v), src, "NumericEq") } @@ -1170,7 +1170,7 @@ func (v *NumericEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// NumericEqQuery is the query value for NumericEq: the operand eql_v3.query_numeric_eq takes. +// NumericEqQuery is the query value for NumericEq: the operand eql_v4.query_numeric_eq takes. type NumericEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1178,7 +1178,7 @@ func (v NumericEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_numeric_eq column. +// Scan reads a eql_v4.query_numeric_eq column. func (v *NumericEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "NumericEqQuery") } @@ -1193,7 +1193,7 @@ func (v *NumericEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// NumericOrdOre is the EQL type stored in public.eql_v3_numeric_ord_ore: the numeric family with the ore index. +// NumericOrdOre is the EQL type stored in public.eql_v4_numeric_ord_ore: the numeric family with the ore index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type NumericOrdOre []byte @@ -1202,7 +1202,7 @@ func (v NumericOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_numeric_ord_ore column. +// Scan reads a public.eql_v4_numeric_ord_ore column. func (v *NumericOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "NumericOrdOre") } @@ -1217,7 +1217,7 @@ func (v *NumericOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// NumericOrdOreQuery is the query value for NumericOrdOre: the operand eql_v3.query_numeric_ord_ore takes. +// NumericOrdOreQuery is the query value for NumericOrdOre: the operand eql_v4.query_numeric_ord_ore takes. type NumericOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1225,7 +1225,7 @@ func (v NumericOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_numeric_ord_ore column. +// Scan reads a eql_v4.query_numeric_ord_ore column. func (v *NumericOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "NumericOrdOreQuery") } @@ -1240,7 +1240,7 @@ func (v *NumericOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// NumericOrd is the EQL type stored in public.eql_v3_numeric_ord: the numeric family with the ope index. +// NumericOrd is the EQL type stored in public.eql_v4_numeric_ord: the numeric family with the ope index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type NumericOrd []byte @@ -1249,7 +1249,7 @@ func (v NumericOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_numeric_ord column. +// Scan reads a public.eql_v4_numeric_ord column. func (v *NumericOrd) Scan(src any) error { return scan((*[]byte)(v), src, "NumericOrd") } @@ -1264,7 +1264,7 @@ func (v *NumericOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// NumericOrdQuery is the query value for NumericOrd: the operand eql_v3.query_numeric_ord takes. +// NumericOrdQuery is the query value for NumericOrd: the operand eql_v4.query_numeric_ord takes. type NumericOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1272,7 +1272,7 @@ func (v NumericOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_numeric_ord column. +// Scan reads a eql_v4.query_numeric_ord column. func (v *NumericOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "NumericOrdQuery") } @@ -1287,7 +1287,7 @@ func (v *NumericOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// NumericOrdOpe is the EQL type stored in public.eql_v3_numeric_ord_ope: the numeric family with the ope index. +// NumericOrdOpe is the EQL type stored in public.eql_v4_numeric_ord_ope: the numeric family with the ope index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type NumericOrdOpe []byte @@ -1296,7 +1296,7 @@ func (v NumericOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_numeric_ord_ope column. +// Scan reads a public.eql_v4_numeric_ord_ope column. func (v *NumericOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "NumericOrdOpe") } @@ -1311,7 +1311,7 @@ func (v *NumericOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// NumericOrdOpeQuery is the query value for NumericOrdOpe: the operand eql_v3.query_numeric_ord_ope takes. +// NumericOrdOpeQuery is the query value for NumericOrdOpe: the operand eql_v4.query_numeric_ord_ope takes. type NumericOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1319,7 +1319,7 @@ func (v NumericOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_numeric_ord_ope column. +// Scan reads a eql_v4.query_numeric_ord_ope column. func (v *NumericOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "NumericOrdOpeQuery") } @@ -1334,7 +1334,7 @@ func (v *NumericOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Text is the EQL type stored in public.eql_v3_text: the text family with no index. +// Text is the EQL type stored in public.eql_v4_text: the text family with no index. // The engine cannot produce it yet: the storage-only text domain follows once TextEq is proven end to end in PostgreSQL. type Text []byte @@ -1343,7 +1343,7 @@ func (v Text) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_text column. +// Scan reads a public.eql_v4_text column. func (v *Text) Scan(src any) error { return scan((*[]byte)(v), src, "Text") } @@ -1358,7 +1358,7 @@ func (v *Text) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextEq is the EQL type stored in public.eql_v3_text_eq: the text family with the eq index. +// TextEq is the EQL type stored in public.eql_v4_text_eq: the text family with the eq index. // The engine produces it from a string. type TextEq []byte @@ -1367,7 +1367,7 @@ func (v TextEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_text_eq column. +// Scan reads a public.eql_v4_text_eq column. func (v *TextEq) Scan(src any) error { return scan((*[]byte)(v), src, "TextEq") } @@ -1382,7 +1382,7 @@ func (v *TextEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextEqQuery is the query value for TextEq: the operand eql_v3.query_text_eq takes. +// TextEqQuery is the query value for TextEq: the operand eql_v4.query_text_eq takes. type TextEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1390,7 +1390,7 @@ func (v TextEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_text_eq column. +// Scan reads a eql_v4.query_text_eq column. func (v *TextEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TextEqQuery") } @@ -1405,7 +1405,7 @@ func (v *TextEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextMatch is the EQL type stored in public.eql_v3_text_match: the text family with the match index. +// TextMatch is the EQL type stored in public.eql_v4_text_match: the text family with the match index. // The engine cannot produce it yet: the engine derives match and OPE terms, but no EQL type is built from them yet. type TextMatch []byte @@ -1414,7 +1414,7 @@ func (v TextMatch) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_text_match column. +// Scan reads a public.eql_v4_text_match column. func (v *TextMatch) Scan(src any) error { return scan((*[]byte)(v), src, "TextMatch") } @@ -1429,7 +1429,7 @@ func (v *TextMatch) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextMatchQuery is the query value for TextMatch: the operand eql_v3.query_text_match takes. +// TextMatchQuery is the query value for TextMatch: the operand eql_v4.query_text_match takes. type TextMatchQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1437,7 +1437,7 @@ func (v TextMatchQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_text_match column. +// Scan reads a eql_v4.query_text_match column. func (v *TextMatchQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TextMatchQuery") } @@ -1452,7 +1452,7 @@ func (v *TextMatchQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextOrdOre is the EQL type stored in public.eql_v3_text_ord_ore: the text family with the eq and ore indexes. +// TextOrdOre is the EQL type stored in public.eql_v4_text_ord_ore: the text family with the eq and ore indexes. // The engine cannot produce it yet: EQL stores a block ORE term and the engine derives a CLLW ORE term; the two are different algorithms. type TextOrdOre []byte @@ -1461,7 +1461,7 @@ func (v TextOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_text_ord_ore column. +// Scan reads a public.eql_v4_text_ord_ore column. func (v *TextOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "TextOrdOre") } @@ -1476,7 +1476,7 @@ func (v *TextOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextOrdOreQuery is the query value for TextOrdOre: the operand eql_v3.query_text_ord_ore takes. +// TextOrdOreQuery is the query value for TextOrdOre: the operand eql_v4.query_text_ord_ore takes. type TextOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1484,7 +1484,7 @@ func (v TextOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_text_ord_ore column. +// Scan reads a eql_v4.query_text_ord_ore column. func (v *TextOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TextOrdOreQuery") } @@ -1499,7 +1499,7 @@ func (v *TextOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextOrd is the EQL type stored in public.eql_v3_text_ord: the text family with the eq and ope indexes. +// TextOrd is the EQL type stored in public.eql_v4_text_ord: the text family with the eq and ope indexes. // The engine cannot produce it yet: the engine derives match and OPE terms, but no EQL type is built from them yet. type TextOrd []byte @@ -1508,7 +1508,7 @@ func (v TextOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_text_ord column. +// Scan reads a public.eql_v4_text_ord column. func (v *TextOrd) Scan(src any) error { return scan((*[]byte)(v), src, "TextOrd") } @@ -1523,7 +1523,7 @@ func (v *TextOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextOrdQuery is the query value for TextOrd: the operand eql_v3.query_text_ord takes. +// TextOrdQuery is the query value for TextOrd: the operand eql_v4.query_text_ord takes. type TextOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1531,7 +1531,7 @@ func (v TextOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_text_ord column. +// Scan reads a eql_v4.query_text_ord column. func (v *TextOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TextOrdQuery") } @@ -1546,7 +1546,7 @@ func (v *TextOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextOrdOpe is the EQL type stored in public.eql_v3_text_ord_ope: the text family with the eq and ope indexes. +// TextOrdOpe is the EQL type stored in public.eql_v4_text_ord_ope: the text family with the eq and ope indexes. // The engine cannot produce it yet: the engine derives match and OPE terms, but no EQL type is built from them yet. type TextOrdOpe []byte @@ -1555,7 +1555,7 @@ func (v TextOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_text_ord_ope column. +// Scan reads a public.eql_v4_text_ord_ope column. func (v *TextOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "TextOrdOpe") } @@ -1570,7 +1570,7 @@ func (v *TextOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextOrdOpeQuery is the query value for TextOrdOpe: the operand eql_v3.query_text_ord_ope takes. +// TextOrdOpeQuery is the query value for TextOrdOpe: the operand eql_v4.query_text_ord_ope takes. type TextOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1578,7 +1578,7 @@ func (v TextOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_text_ord_ope column. +// Scan reads a eql_v4.query_text_ord_ope column. func (v *TextOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TextOrdOpeQuery") } @@ -1593,7 +1593,7 @@ func (v *TextOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextSearchOre is the EQL type stored in public.eql_v3_text_search_ore: the text family with the eq and ore and match indexes. +// TextSearchOre is the EQL type stored in public.eql_v4_text_search_ore: the text family with the eq and ore and match indexes. // The engine cannot produce it yet: EQL stores a block ORE term and the engine derives a CLLW ORE term; the two are different algorithms. type TextSearchOre []byte @@ -1602,7 +1602,7 @@ func (v TextSearchOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_text_search_ore column. +// Scan reads a public.eql_v4_text_search_ore column. func (v *TextSearchOre) Scan(src any) error { return scan((*[]byte)(v), src, "TextSearchOre") } @@ -1617,7 +1617,7 @@ func (v *TextSearchOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextSearchOreQuery is the query value for TextSearchOre: the operand eql_v3.query_text_search_ore takes. +// TextSearchOreQuery is the query value for TextSearchOre: the operand eql_v4.query_text_search_ore takes. type TextSearchOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1625,7 +1625,7 @@ func (v TextSearchOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_text_search_ore column. +// Scan reads a eql_v4.query_text_search_ore column. func (v *TextSearchOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TextSearchOreQuery") } @@ -1640,7 +1640,7 @@ func (v *TextSearchOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextSearch is the EQL type stored in public.eql_v3_text_search: the text family with the eq and ope and match indexes. +// TextSearch is the EQL type stored in public.eql_v4_text_search: the text family with the eq and ope and match indexes. // The engine cannot produce it yet: the engine derives match and OPE terms, but no EQL type is built from them yet. type TextSearch []byte @@ -1649,7 +1649,7 @@ func (v TextSearch) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_text_search column. +// Scan reads a public.eql_v4_text_search column. func (v *TextSearch) Scan(src any) error { return scan((*[]byte)(v), src, "TextSearch") } @@ -1664,7 +1664,7 @@ func (v *TextSearch) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// TextSearchQuery is the query value for TextSearch: the operand eql_v3.query_text_search takes. +// TextSearchQuery is the query value for TextSearch: the operand eql_v4.query_text_search takes. type TextSearchQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1672,7 +1672,7 @@ func (v TextSearchQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_text_search column. +// Scan reads a eql_v4.query_text_search column. func (v *TextSearchQuery) Scan(src any) error { return scan((*[]byte)(v), src, "TextSearchQuery") } @@ -1687,7 +1687,7 @@ func (v *TextSearchQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Boolean is the EQL type stored in public.eql_v3_boolean: the boolean family with no index. +// Boolean is the EQL type stored in public.eql_v4_boolean: the boolean family with no index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type Boolean []byte @@ -1696,7 +1696,7 @@ func (v Boolean) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_boolean column. +// Scan reads a public.eql_v4_boolean column. func (v *Boolean) Scan(src any) error { return scan((*[]byte)(v), src, "Boolean") } @@ -1711,7 +1711,7 @@ func (v *Boolean) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Real is the EQL type stored in public.eql_v3_real: the real family with no index. +// Real is the EQL type stored in public.eql_v4_real: the real family with no index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type Real []byte @@ -1720,7 +1720,7 @@ func (v Real) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_real column. +// Scan reads a public.eql_v4_real column. func (v *Real) Scan(src any) error { return scan((*[]byte)(v), src, "Real") } @@ -1735,7 +1735,7 @@ func (v *Real) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// RealEq is the EQL type stored in public.eql_v3_real_eq: the real family with the eq index. +// RealEq is the EQL type stored in public.eql_v4_real_eq: the real family with the eq index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type RealEq []byte @@ -1744,7 +1744,7 @@ func (v RealEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_real_eq column. +// Scan reads a public.eql_v4_real_eq column. func (v *RealEq) Scan(src any) error { return scan((*[]byte)(v), src, "RealEq") } @@ -1759,7 +1759,7 @@ func (v *RealEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// RealEqQuery is the query value for RealEq: the operand eql_v3.query_real_eq takes. +// RealEqQuery is the query value for RealEq: the operand eql_v4.query_real_eq takes. type RealEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1767,7 +1767,7 @@ func (v RealEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_real_eq column. +// Scan reads a eql_v4.query_real_eq column. func (v *RealEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "RealEqQuery") } @@ -1782,7 +1782,7 @@ func (v *RealEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// RealOrdOre is the EQL type stored in public.eql_v3_real_ord_ore: the real family with the ore index. +// RealOrdOre is the EQL type stored in public.eql_v4_real_ord_ore: the real family with the ore index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type RealOrdOre []byte @@ -1791,7 +1791,7 @@ func (v RealOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_real_ord_ore column. +// Scan reads a public.eql_v4_real_ord_ore column. func (v *RealOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "RealOrdOre") } @@ -1806,7 +1806,7 @@ func (v *RealOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// RealOrdOreQuery is the query value for RealOrdOre: the operand eql_v3.query_real_ord_ore takes. +// RealOrdOreQuery is the query value for RealOrdOre: the operand eql_v4.query_real_ord_ore takes. type RealOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1814,7 +1814,7 @@ func (v RealOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_real_ord_ore column. +// Scan reads a eql_v4.query_real_ord_ore column. func (v *RealOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "RealOrdOreQuery") } @@ -1829,7 +1829,7 @@ func (v *RealOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// RealOrd is the EQL type stored in public.eql_v3_real_ord: the real family with the ope index. +// RealOrd is the EQL type stored in public.eql_v4_real_ord: the real family with the ope index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type RealOrd []byte @@ -1838,7 +1838,7 @@ func (v RealOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_real_ord column. +// Scan reads a public.eql_v4_real_ord column. func (v *RealOrd) Scan(src any) error { return scan((*[]byte)(v), src, "RealOrd") } @@ -1853,7 +1853,7 @@ func (v *RealOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// RealOrdQuery is the query value for RealOrd: the operand eql_v3.query_real_ord takes. +// RealOrdQuery is the query value for RealOrd: the operand eql_v4.query_real_ord takes. type RealOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1861,7 +1861,7 @@ func (v RealOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_real_ord column. +// Scan reads a eql_v4.query_real_ord column. func (v *RealOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "RealOrdQuery") } @@ -1876,7 +1876,7 @@ func (v *RealOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// RealOrdOpe is the EQL type stored in public.eql_v3_real_ord_ope: the real family with the ope index. +// RealOrdOpe is the EQL type stored in public.eql_v4_real_ord_ope: the real family with the ope index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type RealOrdOpe []byte @@ -1885,7 +1885,7 @@ func (v RealOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_real_ord_ope column. +// Scan reads a public.eql_v4_real_ord_ope column. func (v *RealOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "RealOrdOpe") } @@ -1900,7 +1900,7 @@ func (v *RealOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// RealOrdOpeQuery is the query value for RealOrdOpe: the operand eql_v3.query_real_ord_ope takes. +// RealOrdOpeQuery is the query value for RealOrdOpe: the operand eql_v4.query_real_ord_ope takes. type RealOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1908,7 +1908,7 @@ func (v RealOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_real_ord_ope column. +// Scan reads a eql_v4.query_real_ord_ope column. func (v *RealOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "RealOrdOpeQuery") } @@ -1923,7 +1923,7 @@ func (v *RealOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// Double is the EQL type stored in public.eql_v3_double: the double family with no index. +// Double is the EQL type stored in public.eql_v4_double: the double family with no index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type Double []byte @@ -1932,7 +1932,7 @@ func (v Double) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_double column. +// Scan reads a public.eql_v4_double column. func (v *Double) Scan(src any) error { return scan((*[]byte)(v), src, "Double") } @@ -1947,7 +1947,7 @@ func (v *Double) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DoubleEq is the EQL type stored in public.eql_v3_double_eq: the double family with the eq index. +// DoubleEq is the EQL type stored in public.eql_v4_double_eq: the double family with the eq index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type DoubleEq []byte @@ -1956,7 +1956,7 @@ func (v DoubleEq) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_double_eq column. +// Scan reads a public.eql_v4_double_eq column. func (v *DoubleEq) Scan(src any) error { return scan((*[]byte)(v), src, "DoubleEq") } @@ -1971,7 +1971,7 @@ func (v *DoubleEq) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DoubleEqQuery is the query value for DoubleEq: the operand eql_v3.query_double_eq takes. +// DoubleEqQuery is the query value for DoubleEq: the operand eql_v4.query_double_eq takes. type DoubleEqQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -1979,7 +1979,7 @@ func (v DoubleEqQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_double_eq column. +// Scan reads a eql_v4.query_double_eq column. func (v *DoubleEqQuery) Scan(src any) error { return scan((*[]byte)(v), src, "DoubleEqQuery") } @@ -1994,7 +1994,7 @@ func (v *DoubleEqQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DoubleOrdOre is the EQL type stored in public.eql_v3_double_ord_ore: the double family with the ore index. +// DoubleOrdOre is the EQL type stored in public.eql_v4_double_ord_ore: the double family with the ore index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type DoubleOrdOre []byte @@ -2003,7 +2003,7 @@ func (v DoubleOrdOre) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_double_ord_ore column. +// Scan reads a public.eql_v4_double_ord_ore column. func (v *DoubleOrdOre) Scan(src any) error { return scan((*[]byte)(v), src, "DoubleOrdOre") } @@ -2018,7 +2018,7 @@ func (v *DoubleOrdOre) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DoubleOrdOreQuery is the query value for DoubleOrdOre: the operand eql_v3.query_double_ord_ore takes. +// DoubleOrdOreQuery is the query value for DoubleOrdOre: the operand eql_v4.query_double_ord_ore takes. type DoubleOrdOreQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -2026,7 +2026,7 @@ func (v DoubleOrdOreQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_double_ord_ore column. +// Scan reads a eql_v4.query_double_ord_ore column. func (v *DoubleOrdOreQuery) Scan(src any) error { return scan((*[]byte)(v), src, "DoubleOrdOreQuery") } @@ -2041,7 +2041,7 @@ func (v *DoubleOrdOreQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DoubleOrd is the EQL type stored in public.eql_v3_double_ord: the double family with the ope index. +// DoubleOrd is the EQL type stored in public.eql_v4_double_ord: the double family with the ope index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type DoubleOrd []byte @@ -2050,7 +2050,7 @@ func (v DoubleOrd) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_double_ord column. +// Scan reads a public.eql_v4_double_ord column. func (v *DoubleOrd) Scan(src any) error { return scan((*[]byte)(v), src, "DoubleOrd") } @@ -2065,7 +2065,7 @@ func (v *DoubleOrd) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DoubleOrdQuery is the query value for DoubleOrd: the operand eql_v3.query_double_ord takes. +// DoubleOrdQuery is the query value for DoubleOrd: the operand eql_v4.query_double_ord takes. type DoubleOrdQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -2073,7 +2073,7 @@ func (v DoubleOrdQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_double_ord column. +// Scan reads a eql_v4.query_double_ord column. func (v *DoubleOrdQuery) Scan(src any) error { return scan((*[]byte)(v), src, "DoubleOrdQuery") } @@ -2088,7 +2088,7 @@ func (v *DoubleOrdQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DoubleOrdOpe is the EQL type stored in public.eql_v3_double_ord_ope: the double family with the ope index. +// DoubleOrdOpe is the EQL type stored in public.eql_v4_double_ord_ope: the double family with the ope index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type DoubleOrdOpe []byte @@ -2097,7 +2097,7 @@ func (v DoubleOrdOpe) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_double_ord_ope column. +// Scan reads a public.eql_v4_double_ord_ope column. func (v *DoubleOrdOpe) Scan(src any) error { return scan((*[]byte)(v), src, "DoubleOrdOpe") } @@ -2112,7 +2112,7 @@ func (v *DoubleOrdOpe) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// DoubleOrdOpeQuery is the query value for DoubleOrdOpe: the operand eql_v3.query_double_ord_ope takes. +// DoubleOrdOpeQuery is the query value for DoubleOrdOpe: the operand eql_v4.query_double_ord_ope takes. type DoubleOrdOpeQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -2120,7 +2120,7 @@ func (v DoubleOrdOpeQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_double_ord_ope column. +// Scan reads a eql_v4.query_double_ord_ope column. func (v *DoubleOrdOpeQuery) Scan(src any) error { return scan((*[]byte)(v), src, "DoubleOrdOpeQuery") } @@ -2135,7 +2135,7 @@ func (v *DoubleOrdOpeQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SteVecDocument is the EQL type stored in public.eql_v3_json_search: the json family with the json index. +// SteVecDocument is the EQL type stored in public.eql_v4_json_search: the json family with the json index. // The engine cannot produce it yet: the JSON index is a new operation in the engine. type SteVecDocument []byte @@ -2144,7 +2144,7 @@ func (v SteVecDocument) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_json_search column. +// Scan reads a public.eql_v4_json_search column. func (v *SteVecDocument) Scan(src any) error { return scan((*[]byte)(v), src, "SteVecDocument") } @@ -2159,7 +2159,7 @@ func (v *SteVecDocument) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// SteVecQuery is the query value for SteVecDocument: the operand eql_v3.query_json takes. +// SteVecQuery is the query value for SteVecDocument: the operand eql_v4.query_json takes. type SteVecQuery []byte // Value is the EQL value as the driver takes it: the JSON text, or NULL when empty. @@ -2167,7 +2167,7 @@ func (v SteVecQuery) Value() (driver.Value, error) { return value(v) } -// Scan reads a eql_v3.query_json column. +// Scan reads a eql_v4.query_json column. func (v *SteVecQuery) Scan(src any) error { return scan((*[]byte)(v), src, "SteVecQuery") } @@ -2182,7 +2182,7 @@ func (v *SteVecQuery) UnmarshalJSON(b []byte) error { return unmarshal((*[]byte)(v), b) } -// JSON is the EQL type stored in public.eql_v3_json: the json family with no index. +// JSON is the EQL type stored in public.eql_v4_json: the json family with no index. // The engine cannot produce it yet: how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is. type JSON []byte @@ -2191,7 +2191,7 @@ func (v JSON) Value() (driver.Value, error) { return value(v) } -// Scan reads a public.eql_v3_json column. +// Scan reads a public.eql_v4_json column. func (v *JSON) Scan(src any) error { return scan((*[]byte)(v), src, "JSON") } diff --git a/languages/golang/encrypt/eql/eql_test.go b/languages/golang/encrypt/eql/eql_test.go index d951dc36f..426158bd7 100644 --- a/languages/golang/encrypt/eql/eql_test.go +++ b/languages/golang/encrypt/eql/eql_test.go @@ -23,7 +23,7 @@ func TestTypesTableNamesTextEqAsTheOneProducibleType(t *testing.T) { t.Fatalf("producible = %v, want [TextEq]", producible) } textEq, ok := eql.Lookup("TextEq") - if !ok || textEq.GoName != "TextEq" || textEq.Plaintext != "string" || textEq.Query != "TextEqQuery" || textEq.SQLDomain != "public.eql_v3_text_eq" || len(textEq.Indexes) != 1 || textEq.Indexes[0] != "eq" { + if !ok || textEq.GoName != "TextEq" || textEq.Plaintext != "string" || textEq.Query != "TextEqQuery" || textEq.SQLDomain != "public.eql_v4_text_eq" || len(textEq.Indexes) != 1 || textEq.Indexes[0] != "eq" { t.Fatalf("TextEq = %+v", textEq) } if j, ok := eql.Lookup("Json"); !ok || j.GoName != "JSON" { @@ -35,7 +35,7 @@ func TestTypesTableNamesTextEqAsTheOneProducibleType(t *testing.T) { } func TestValuesRoundTripThroughTheDriverAndJSON(t *testing.T) { - doc := []byte(`{"v":3,"i":{"t":"users","c":"email"},"c":"stack-encrypt:1:AA==","hm":"00"}`) + doc := []byte(`{"v":4,"i":{"t":"users","c":"email"},"c":"stack-encrypt:1:AA==","hm":"00"}`) v := eql.TextEq(doc) value, err := v.Value() if err != nil || value != string(doc) { diff --git a/languages/golang/encrypt/eql_test.go b/languages/golang/encrypt/eql_test.go index 833724c85..9c7d1bdd2 100644 --- a/languages/golang/encrypt/eql_test.go +++ b/languages/golang/encrypt/eql_test.go @@ -41,8 +41,8 @@ var contacts = []testusers.Contact{ {ID: 3, Email: "bob@example.com"}, } -// eqlEnvelope is the EQL v3 envelope of a TextEq value, as PostgreSQL's -// public.eql_v3_text_eq domain checks it. +// eqlEnvelope is the EQL v4 envelope of a TextEq value, as PostgreSQL's +// public.eql_v4_text_eq domain checks it. type eqlEnvelope struct { V int `json:"v"` I struct{ T, C string } @@ -91,8 +91,8 @@ func TestTextEqFieldSealsToTheEQLEnvelope(t *testing.T) { t.Errorf("row %d: passthrough id %d, want %d", i, e.ID, contacts[i].ID) } env := decodeEnvelope(t, e.Email) - if env.V != 3 { - t.Errorf("row %d: v = %d, want 3", i, env.V) + if env.V != 4 { + t.Errorf("row %d: v = %d, want 4", i, env.V) } if env.I.T != "users" || env.I.C != "email" { t.Errorf("row %d: i = %+v, want users/email", i, env.I) @@ -217,7 +217,7 @@ func TestATamperedEQLValueDoesNotOpen(t *testing.T) { for name, value := range map[string]eql.TextEq{ "an empty object": eql.TextEq(`{}`), "not JSON": eql.TextEq(`not json`), - "a query value": eql.TextEq(`{"v":3,"i":{"t":"users","c":"email"},"hm":"00"}`), + "a query value": eql.TextEq(`{"v":4,"i":{"t":"users","c":"email"},"hm":"00"}`), } { junk[0].Email = value if _, err := testusers.DecryptContact(ctx, cipher, junk); !errors.Is(err, encrypt.ErrEncoding) { diff --git a/languages/golang/encrypt/guest/src/ops.rs b/languages/golang/encrypt/guest/src/ops.rs index 9b0a8c9ac..c33466ee7 100644 --- a/languages/golang/encrypt/guest/src/ops.rs +++ b/languages/golang/encrypt/guest/src/ops.rs @@ -208,7 +208,7 @@ where /// Derive the EQL query value of one target field: a codec-encoded /// plaintext, the codec-encoded plan and the field's name (UTF-8) in, the -/// query value's JSON bytes out — the operand `eql_v3.query_` takes. +/// query value's JSON bytes out — the operand `eql_v4.query_` takes. /// Runs the EQL type's own query plan through this build's resolver /// ([`crate::targets`]); a build without EQL types refuses the plan before /// this is reached. No data key is minted: under the local backend the @@ -731,7 +731,7 @@ mod tests { validate::record(&source, &plan).expect("the source fits"); let sealed = block_on(encrypt_record(&keyset, &source, &plan)).expect("seals"); - // The stored tree carries the EQL JSON under "eql": the v3 envelope + // The stored tree carries the EQL JSON under "eql": the v4 envelope // with the column as its i and a stack-encrypt ciphertext. let tree = decode_tree(&sealed).expect("a tree"); let CipherText::Map(mut fields) = tree else { @@ -753,7 +753,7 @@ mod tests { panic!("bytes") }; let eql: serde_json::Value = serde_json::from_slice(bytes.risky_ref()).expect("JSON"); - assert_eq!(eql["v"], 3); + assert_eq!(eql["v"], 4, "Stack Encrypt writes EQL v4"); assert_eq!(eql["i"], serde_json::json!({"t": "users", "c": "email"})); assert!(eql["c"].as_str().unwrap().starts_with("stack-encrypt:1:")); assert_eq!(eql["hm"].as_str().unwrap().len(), 64); diff --git a/languages/golang/encrypt/records.go b/languages/golang/encrypt/records.go index 424184526..443279e35 100644 --- a/languages/golang/encrypt/records.go +++ b/languages/golang/encrypt/records.go @@ -174,7 +174,7 @@ func (cph *Cipher) Derive(ctx context.Context, plan *record.Plan, field string, // Query derives the EQL query value of a field that names an EQL type, for // one value: the operand that matches stored values of the field, as the -// JSON bytes the field's eql_v3.query_* domain takes. The engine runs the +// JSON bytes the field's eql_v4.query_* domain takes. The engine runs the // EQL type's own query plan; no data key is minted. For generated code. func (cph *Cipher) Query(ctx context.Context, plan *record.Plan, field string, value any) ([]byte, error) { p, err := cph.plan(plan) diff --git a/languages/golang/encrypt/targets_test.go b/languages/golang/encrypt/targets_test.go index 69a007acf..50f883ae6 100644 --- a/languages/golang/encrypt/targets_test.go +++ b/languages/golang/encrypt/targets_test.go @@ -16,13 +16,13 @@ func TestParseTargetsReadsEachEntry(t *testing.T) { entry := func(fields ...vcvalue.Field) vcvalue.Object { return vcvalue.Object(fields) } textEq := entry( vcvalue.Field{Key: "name", Value: "TextEq"}, vcvalue.Field{Key: "family", Value: "Text"}, vcvalue.Field{Key: "suffix", Value: "Eq"}, - vcvalue.Field{Key: "plaintext", Value: "string"}, vcvalue.Field{Key: "sql_domain", Value: "eql_v3_text_eq"}, + vcvalue.Field{Key: "plaintext", Value: "string"}, vcvalue.Field{Key: "sql_domain", Value: "eql_v4_text_eq"}, vcvalue.Field{Key: "indexes", Value: []any{"eq"}}, vcvalue.Field{Key: "query", Value: "TextEqQuery"}, - vcvalue.Field{Key: "query_sql_domain", Value: "eql_v3.query_text_eq"}, vcvalue.Field{Key: "producible", Value: true}, vcvalue.Field{Key: "reason", Value: nil}, + vcvalue.Field{Key: "query_sql_domain", Value: "eql_v4.query_text_eq"}, vcvalue.Field{Key: "producible", Value: true}, vcvalue.Field{Key: "reason", Value: nil}, ) notYet := entry( vcvalue.Field{Key: "name", Value: "JSON"}, vcvalue.Field{Key: "family", Value: "JSON"}, vcvalue.Field{Key: "suffix", Value: ""}, - vcvalue.Field{Key: "plaintext", Value: nil}, vcvalue.Field{Key: "sql_domain", Value: "eql_v3_json"}, + vcvalue.Field{Key: "plaintext", Value: nil}, vcvalue.Field{Key: "sql_domain", Value: "eql_v4_json"}, vcvalue.Field{Key: "indexes", Value: []any{"json"}}, vcvalue.Field{Key: "query", Value: nil}, vcvalue.Field{Key: "query_sql_domain", Value: nil}, vcvalue.Field{Key: "producible", Value: false}, vcvalue.Field{Key: "reason", Value: "the JSON index is a new operation in the engine"}, ) @@ -31,8 +31,8 @@ func TestParseTargetsReadsEachEntry(t *testing.T) { t.Fatal(err) } want := []record.Target{ - {Name: "TextEq", Family: "Text", Suffix: "Eq", Plaintext: record.String, SQLDomain: "eql_v3_text_eq", Indexes: []record.Output{record.Equality}, Query: "TextEqQuery", QuerySQLDomain: "eql_v3.query_text_eq", Producible: true}, - {Name: "JSON", Family: "JSON", Plaintext: record.Untyped, SQLDomain: "eql_v3_json", Indexes: []record.Output{"json"}, Reason: "the JSON index is a new operation in the engine"}, + {Name: "TextEq", Family: "Text", Suffix: "Eq", Plaintext: record.String, SQLDomain: "eql_v4_text_eq", Indexes: []record.Output{record.Equality}, Query: "TextEqQuery", QuerySQLDomain: "eql_v4.query_text_eq", Producible: true}, + {Name: "JSON", Family: "JSON", Plaintext: record.Untyped, SQLDomain: "eql_v4_json", Indexes: []record.Output{"json"}, Reason: "the JSON index is a new operation in the engine"}, } if !reflect.DeepEqual(got, want) { t.Fatalf("parseTargets =\n%+v\nwant\n%+v", got, want) diff --git a/packages/eql/AGENTS.md b/packages/eql/AGENTS.md index 7f457d102..c63d9f676 100644 --- a/packages/eql/AGENTS.md +++ b/packages/eql/AGENTS.md @@ -88,7 +88,9 @@ This is the **Encrypt Query Language (EQL)** - a PostgreSQL extension for search Adding a scalar encrypted-domain type is one row in the Rust catalog `eql-domains::CATALOG` (`crates/eql-domains/src/lib.rs`): a `DomainFamily` giving the type `name` (e.g. `bigint`), its `ScalarKind` (the `kind` field), the `Domain`s mapping each generated (bare) domain name to its fixed index `Term`s (`eq => [Hm]`, `ord`/`ord_ore => [Ore]`), and the `Fixture` value list. Term capabilities are fixed in the `Term` enum's `impl` methods (with unit tests): `Hm` provides equality, and `Ore` provides equality plus ordering. There is no TOML manifest and no Python — the catalog is the source of truth, validated by the compiler (an undefined term or unknown scalar is a compile error) plus catalog `#[test]`s. `mise run build` runs `cargo run -p eql-codegen`, which regenerates the scalar SQL surface into `src/v3/scalars//` from `CATALOG` at the start of every build; that surface includes supported comparison wrappers plus blockers for native `json` operators that would otherwise be reachable through domain fallback. `cargo run -p eql-codegen` regenerates every type at once (the same call `mise run build` uses; there is no per-type codegen task). The generated `*_types.sql` / `*_functions.sql` / `*_operators.sql` / `*_aggregates.sql` files are **committed in place** under `src/v3/scalars//` and drift-gated by `mise run codegen:parity` (regenerate in place + `git diff` + untracked check — the same regenerate-and-diff pattern `types:check` uses for the committed bindings). They are still machine-generated: change the catalog and rebuild, never hand-edit (CI fails on drift). The per-type plaintext fixture lists the SQLx matrix consumes are **not** a generated file — they are materialised from each `CATALOG` row at compile time as `eql_domains::INT4_VALUES` / `INT2_VALUES` (the `int_values!` macro) and read directly by `ScalarType::FIXTURE_VALUES`; a Rust source of truth no longer round-trips through a committed generated `.rs`. Generated SQL carries a `-- AUTOMATICALLY GENERATED FILE` header (the project-wide marker `docs:validate` greps on); change the catalog and rebuild, never hand-edit. Hand-written SQL beyond the fixed surface goes in `src/v3/scalars//_extensions.sql` with no auto-generated header and explicit `-- REQUIRE:` edges — that file IS committed. `json`'s **SteVec** domains never enter this pipeline, but its **scalar storage domain does**: `generate_all` iterates `eql_domains::families_with_scalar_domains()` and renders each family's scalar domains (so `public.eql_v3_json` is generated into `src/v3/scalars/json/`), while `list-types` and the SQLx matrix still iterate `eql_domains::scalar_families()`, which excludes the whole non-scalar `json` family — so `json` stays out of the operator/coverage matrix by construction (a storage-only domain carries no operator matrix), even though its ciphertext-only storage domain now has a generated SQL surface. -The same generator also emits the **Rust payload bindings** under `crates/eql-bindings/src/v3/.rs` (structs + `DomainType` impls) and the `inventory.rs` `all()` list, from the same `CATALOG` — committed with a `// @generated` header (the bindings must exist on a clean clone because `ts-rs`/`schemars` derive the committed TypeScript/JSON Schema off them; the SQL surface is now committed too, so both generated targets are handled consistently — committed in place, drift-gated by regenerate-and-`git diff`). The hand-written `DomainType` trait, the shared newtypes (`SchemaVersion`/`Identifier`/`Ciphertext`/`Hmac256`/`OreBlock256`/`BloomFilter`), the `PhantomData` plumbing, and the architectural module doc (including the non-derivable float-NaN and bool storage-only caveats) stay hand-written in `crates/eql-bindings/src/v3/{mod,domain_type,terms}.rs`. Generated structs carry a catalog-derived struct doc — a summary line (`` `eql_v3.` — . ``) plus a detail line listing the supported operators and required payload keys, all derived from data the catalog already holds (the capability label, `Term::operators_for_terms`, and `ENVELOPE_KEYS` ++ `Term::term_json_keys` — see `struct_doc_lines` in `crates/eql-codegen/src/bindings.rs`). The required-key list makes structural distinctions visible — e.g. `text_ord` lists `` `v` `i` `c` `hm` `ob` `` (dual-term) versus an integer `integer_ord`'s `` `v` `i` `c` `ob` ``. There are **no per-field docs**: per-field/term semantics live on the shared term newtypes (`terms.rs`, flowing into the TS term files and JSON Schema `$defs`), and non-derivable per-family caveats (float-NaN, bool storage-only) in `mod.rs`. Free-form prose belongs at the **struct level** (a future optional catalog `doc` field emitted as extra `#[doc]` lines), never as per-field docs. JSON Schemas are emitted by **schemars 1.x** as JSON Schema 2020-12. `mise run types:generate` regenerates the Rust bindings (via `eql-codegen bindings`) then the TS/JSON; `mise run types:check` is the committed-reference drift gate — it regenerates and `git diff`s all three (`crates/eql-bindings/src/v3` + `bindings/` + `schema/`), the same regenerate-and-diff pattern `codegen:parity` now uses for the committed SQL surface. Both gates run in CI; `mise run install-hooks` wires a pre-commit hook that runs both locally whenever a commit touches the catalog, the generator, or a committed generated surface. The `json` family's **SteVec** structs (`SteVecDocument`, `SteVecEntry`, `SteVecQuery`, and `SteVecQueryEntry`) are hand-written for the same reason as their SQL — in `crates/eql-bindings/src/v3/json.rs`, symmetric with `src/v3/json/`. Their direct optional fields and `deny_unknown_fields` validation keep the Rust, TypeScript, JSON Schema, and PostgreSQL entry contracts aligned. The family's scalar storage struct **is** generated (a flat `{v,i,c}` struct, `Json`), via `render_scalar_only_bindings(&JSON)` into `crates/eql-bindings/src/v3/json_storage.rs`; the hand-written `json.rs` re-exports it (`pub use crate::v3::json_storage::Json;`) so `super::json::Json` resolves for the generated inventory/payload. Only inventory membership and ordering are catalog-driven: `inventory.rs::all()` iterates the full `CATALOG` (not `scalar_families()`), branching on `Shape` to include the three SteVec structs plus the generated `Json` alongside the other scalar structs. +**EQL v4 bindings:** the generator writes the scalar domains a second time into `crates/eql-bindings/src/v4/` (`eql_v4_*` names, `v: 4` through `SchemaVersion<4>`, an `inventory.rs`), plus the Stack Encrypt target table `v4/targets.rs`. **Only v4 structs derive Stack Encrypt's `EncryptFrom`/`DecryptInto`**: Stack Encrypt's output is not byte-for-byte compatible with cipherstash-client's, so `encryption_gap` refuses every v3 domain and a codegen test asserts no v3 struct derives either. v4 has no SteVec bindings, payload enums, TypeScript export or published JSON Schema yet. The hand-written `v4/mod.rs` re-exports v3's term newtypes and `DomainType`, so a change to a term's validation in `v3/terms.rs` changes v4 too; the version boundary is the envelope's `SchemaVersion` (one generic type in `lib.rs`; `v3::SchemaVersion` and `v4::SchemaVersion` are `SchemaVersion<3>` and `SchemaVersion<4>`). + +The same generator also emits the **Rust payload bindings** under `crates/eql-bindings/src/v3/.rs` (structs + `DomainType` impls) and the `inventory.rs` `all()` list, from the same `CATALOG` — committed with a `// @generated` header (the bindings must exist on a clean clone because `ts-rs`/`schemars` derive the committed TypeScript/JSON Schema off them; the SQL surface is now committed too, so both generated targets are handled consistently — committed in place, drift-gated by regenerate-and-`git diff`). The hand-written `DomainType` trait, the shared newtypes (`SchemaVersion`/`Identifier`/`Ciphertext`/`Hmac256`/`OreBlock256`/`BloomFilter`), the `PhantomData` plumbing, and the architectural module doc (including the non-derivable float-NaN and bool storage-only caveats) stay hand-written in `crates/eql-bindings/src/v3/{mod,domain_type,terms}.rs`. Generated structs carry a catalog-derived struct doc — a summary line (`` `eql_v3.` — . ``) plus a detail line listing the supported operators and required payload keys, all derived from data the catalog already holds (the capability label, `Term::operators_for_terms`, and `ENVELOPE_KEYS` ++ `Term::term_json_keys` — see `struct_doc_lines` in `crates/eql-codegen/src/bindings.rs`). The required-key list makes structural distinctions visible — e.g. `text_ord` lists `` `v` `i` `c` `hm` `ob` `` (dual-term) versus an integer `integer_ord`'s `` `v` `i` `c` `ob` ``. There are **no per-field docs**: per-field/term semantics live on the shared term newtypes (`terms.rs`, flowing into the TS term files and JSON Schema `$defs`), and non-derivable per-family caveats (float-NaN, bool storage-only) in `mod.rs`. Free-form prose belongs at the **struct level** (a future optional catalog `doc` field emitted as extra `#[doc]` lines), never as per-field docs. JSON Schemas are emitted by **schemars 1.x** as JSON Schema 2020-12. `mise run types:generate` regenerates the Rust bindings (via `eql-codegen bindings`) then the TS/JSON; `mise run types:check` is the committed-reference drift gate — it regenerates and `git diff`s the Rust bindings (`crates/eql-bindings/src/v3` and `src/v4`), `bindings/` and `schema/`, the same regenerate-and-diff pattern `codegen:parity` now uses for the committed SQL surface. Both gates run in CI; `mise run install-hooks` wires a pre-commit hook that runs both locally whenever a commit touches the catalog, the generator, or a committed generated surface. The `json` family's **SteVec** structs (`SteVecDocument`, `SteVecEntry`, `SteVecQuery`, and `SteVecQueryEntry`) are hand-written for the same reason as their SQL — in `crates/eql-bindings/src/v3/json.rs`, symmetric with `src/v3/json/`. Their direct optional fields and `deny_unknown_fields` validation keep the Rust, TypeScript, JSON Schema, and PostgreSQL entry contracts aligned. The family's scalar storage struct **is** generated (a flat `{v,i,c}` struct, `Json`), via `render_scalar_only_bindings(&JSON)` into `crates/eql-bindings/src/v3/json_storage.rs`; the hand-written `json.rs` re-exports it (`pub use crate::v3::json_storage::Json;`) so `super::json::Json` resolves for the generated inventory/payload. Only inventory membership and ordering are catalog-driven: `inventory.rs::all()` iterates the full `CATALOG` (not `scalar_families()`), branching on `Shape` to include the three SteVec structs plus the generated `Json` alongside the other scalar structs. **Adding a new encrypted-domain type: follow `docs/reference/adding-a-scalar-encrypted-domain-type.md`.** The mechanics are fixed for ordered scalar domains; the catalog row only declares the name, kind, bare domain names, and terms. New term behavior belongs in the `Term` enum's `impl` methods in `crates/eql-domains/src` with tests, not in free-form catalog data. diff --git a/packages/eql/crates/eql-bindings/README.md b/packages/eql/crates/eql-bindings/README.md index 823db57d4..f4bb4c87e 100644 --- a/packages/eql/crates/eql-bindings/README.md +++ b/packages/eql/crates/eql-bindings/README.md @@ -101,9 +101,11 @@ evolution plan. ## Rust text equality with Stack Encrypt -The optional `stack-encrypt` feature enables `EncryptFrom` for `TextEq` -and `TextEqQuery`, and `DecryptInto` for `TextEq`. Other domains do not -yet expose these conversions. The derives are emitted by `eql-codegen`. +The optional `stack-encrypt` feature enables `EncryptFrom` for +`v4::text::TextEq` and `v4::text::TextEqQuery`, and `DecryptInto` for +`v4::text::TextEq`. Stack Encrypt writes EQL v4 only, so no `v3` type +implements these traits. Other v4 domains do not yet expose these conversions. +The derives are emitted by `eql-codegen`. The generated API docs include a complete, executable example in the `eql_bindings::encryption` module, from cipher setup through decryption. Its @@ -117,7 +119,7 @@ cargo test -p eql-encryption-tests --test text_eq_example With an initialized cipher, the essential calls are: ```rust,ignore -use eql_bindings::{Identifier, v3::text::{TextEq, TextEqQuery}}; +use eql_bindings::{Identifier, v4::text::{TextEq, TextEqQuery}}; let column = Identifier::for_column("users", "email")?; let keyset = cipher.default_keyset(); @@ -144,8 +146,8 @@ This is a **new producer profile**, independent of existing cipherstash-client ciphertext and terms. `c` is `stack-encrypt:1:` followed by padded standard base64 of Stack Encrypt's native `SealedValue` bytes; `hm` is the native 32-byte equality term encoded as hex. Serde handles the final EQL JSON envelope only. SQL consumes -these payloads through the existing `public.eql_v3_text_eq` and -`eql_v3.query_text_eq` domains and their equality extractor index. Writers and +these payloads through the `public.eql_v4_text_eq` and +`eql_v4.query_text_eq` domains and their equality extractor index. Writers and query producers for these values must use this same profile. The `Identifier` stored in `i` is Stack Encrypt's `Describe`: its ZeroKMS @@ -165,12 +167,13 @@ assumed. Outcomes against today's sources: | Rust (`stack-encrypt` profile) | JS / FFI | **Not supported.** The JS reader does not know the `stack-encrypt:1:` prefix and the two profiles' equality terms never match. | Rows 2 and 3 need compatible encryption, decryption and index derivation on -both sides before they can change; that is upstream work, not a flag. This -profile is an interim step on EQL v3: nothing in a `v: 3` payload marks which -producer made an equality term, so a new-profile probe against an old-producer -column returns zero rows with no error. The separation will come from the EQL -version itself (v4), not from a marker inside v3. Until then, one profile per -column, and record which. +both sides before they can change; that is upstream work, not a flag. The +profiles are separated by EQL version (ADR-0002): Stack Encrypt writes the +`eql_v4` domains and only the [`v4`](src/v4/mod.rs) types derive its traits, +while cipherstash-client writes `eql_v3`. A payload of the wrong version fails +the domain check on insert. A plain `=` between a v3 column and a v4 query +term still returns zero rows with no error, so keep each column to one +version. ### EQL types as plan field targets @@ -200,8 +203,8 @@ let probe: Vec = targets::query("TextEq", &keyset, &column, FfiValue::String let opened: FfiValue = targets::decrypt("TextEq", &cipher, &column, &stored)?.await?; ``` -The table and the dispatch are generated into `src/v3/targets.rs` beside -`inventory.rs` (`mise run types:generate`), gated to the `stack-encrypt` +The table and the dispatch are generated into `src/v4/targets.rs` beside +the v4 family modules (`mise run types:generate`), gated to the `stack-encrypt` feature, and drift-gated by the same parity tests. The same generator writes the Go package `languages/golang/encrypt/eql` from the same rows (`eql-codegen go-eql`, also under `types:generate` / `types:check`). The diff --git a/packages/eql/crates/eql-bindings/src/encryption.rs b/packages/eql/crates/eql-bindings/src/encryption.rs index fccab8307..3588f30f6 100644 --- a/packages/eql/crates/eql-bindings/src/encryption.rs +++ b/packages/eql/crates/eql-bindings/src/encryption.rs @@ -6,10 +6,11 @@ //! folding. The stored identifier supplies context for ciphertext and terms. //! //! This is a new producer profile, independent of existing cipherstash-client -//! ciphertext and terms. The EQL envelope and SQL domains remain unchanged. +//! ciphertext and terms, so it writes the `eql_v4` domains ([`crate::v4`]), +//! never `eql_v3` (ADR-0002). //! -//! [`TextEq`]: crate::v3::text::TextEq -//! [`TextEqQuery`]: crate::v3::text::TextEqQuery +//! [`TextEq`]: crate::v4::text::TextEq +//! [`TextEqQuery`]: crate::v4::text::TextEqQuery //! //! # Example //! @@ -55,24 +56,24 @@ //! //! Query terms cannot recover plaintext: //! ```compile_fail -//! use eql_bindings::v3::text::TextEqQuery; +//! use eql_bindings::v4::text::TextEqQuery; //! fn require>() {} //! require::(); //! ``` //! An encrypted EQL record is not a plaintext value: //! ```compile_fail -//! use eql_bindings::v3::text::TextEq; +//! use eql_bindings::v4::text::TextEq; //! fn require() {} //! require::(); //! ``` //! The text domain accepts text, and requires a concrete column identifier: //! ```compile_fail -//! use eql_bindings::v3::text::TextEq; +//! use eql_bindings::v4::text::TextEq; //! fn require>() {} //! require::(); //! ``` //! ```compile_fail -//! use eql_bindings::v3::text::TextEq; +//! use eql_bindings::v4::text::TextEq; //! fn require>() {} //! require::(); //! ``` diff --git a/packages/eql/crates/eql-bindings/src/encryption/example.rs b/packages/eql/crates/eql-bindings/src/encryption/example.rs index 58a482b94..aa67c3438 100644 --- a/packages/eql/crates/eql-bindings/src/encryption/example.rs +++ b/packages/eql/crates/eql-bindings/src/encryption/example.rs @@ -1,5 +1,5 @@ use eql_bindings::{ - v3::text::{TextEq, TextEqQuery}, + v4::text::{TextEq, TextEqQuery}, Identifier, }; use stack_encrypt::StackCipher; diff --git a/packages/eql/crates/eql-bindings/src/encryption/targets.rs b/packages/eql/crates/eql-bindings/src/encryption/targets.rs index 06dc034f1..b3c6d9944 100644 --- a/packages/eql/crates/eql-bindings/src/encryption/targets.rs +++ b/packages/eql/crates/eql-bindings/src/encryption/targets.rs @@ -10,7 +10,7 @@ //! the typed call runs. Nothing here derives a term or seals a byte itself //! (ADR-0007: one engine, entered through a plan); the dispatch is generated //! from `eql-domains::CATALOG` by `eql-codegen` into -//! [`crate::v3::targets`], beside the inventory, so a type cannot be in the +//! [`crate::v4::targets`], beside the v4 family modules, so a type cannot be in the //! catalog and missing from the table. //! //! The guest build that holds the EQL types links this module; the build @@ -30,10 +30,10 @@ //! "family": "text", //! "suffix": "Eq", //! "plaintext": "string", -//! "sql_domain": "public.eql_v3_text_eq", +//! "sql_domain": "public.eql_v4_text_eq", //! "indexes": ["eq"], //! "query": "TextEqQuery", -//! "query_sql_domain": "eql_v3.query_text_eq", +//! "query_sql_domain": "eql_v4.query_text_eq", //! "producible": true, //! "reason": null //! } @@ -86,7 +86,7 @@ use stack_encrypt::{ }; use vitaminc_aead_value::{FfiValue, ValueKind}; -use crate::v3::targets::{decrypt_named, encrypt_named, query_named, TARGETS}; +use crate::v4::targets::{decrypt_named, encrypt_named, query_named, TARGETS}; use crate::Identifier; /// One EQL type a plan may name as a field target: a row of [`targets`]. @@ -108,7 +108,7 @@ pub struct Target { /// or `None` while the family's encoding is unspecified. See /// [`plaintext_kind`](Self::plaintext_kind) for the parsed kind. pub plaintext: Option<&'static str>, - /// The stored value's PostgreSQL domain: `public.eql_v3_text_eq`. + /// The stored value's PostgreSQL domain: `public.eql_v4_text_eq`. pub sql_domain: &'static str, /// The indexes the type carries, by `IndexSpec::key()` name. pub indexes: &'static [&'static str], @@ -392,7 +392,7 @@ mod sealed { /// plaintext types the catalog's producible families name, and the generated /// dispatch picks one per type. `Zeroize`, because [`from_value`](Self::from_value) /// copies the plaintext out of the runtime value's `Protected` buffer and -/// the copy is wiped when it is dropped ([`run_target`] holds it in +/// the copy is wiped when it is dropped (the dispatch holds it in /// [`zeroize::Zeroizing`]), as the original is. pub trait Plaintext: sealed::Sealed + Sized + MaybeSend + zeroize::Zeroize + 'static { /// The kind of value this plaintext is. @@ -520,7 +520,7 @@ mod tests { ); assert_eq!( target("TextEq").map(|t| t.sql_domain), - Some("public.eql_v3_text_eq") + Some("public.eql_v4_text_eq") ); assert_eq!(target("texteq"), None, "names match exactly"); for t in targets() { @@ -549,7 +549,7 @@ mod tests { family: "text", suffix: "", plaintext: Some("string"), - sql_domain: "public.eql_v3_text", + sql_domain: "public.eql_v4_text", indexes: &[], query: None, query_sql_domain: None, diff --git a/packages/eql/crates/eql-bindings/src/lib.rs b/packages/eql/crates/eql-bindings/src/lib.rs index 1a0f3458f..bd5c61b50 100644 --- a/packages/eql/crates/eql-bindings/src/lib.rs +++ b/packages/eql/crates/eql-bindings/src/lib.rs @@ -44,6 +44,7 @@ use ts_rs::TS; pub mod from_v2; pub mod sql; pub mod v3; +pub mod v4; #[cfg(feature = "stack-encrypt")] pub mod encryption; @@ -61,13 +62,18 @@ pub const EQL_SCHEMA_VERSION: u16 = 3; /// CHECK's `VALUE->>'v' = '3'`, so a wrong-version payload fails at the type /// boundary instead of at INSERT. The inner value is private; the only /// constructible instance is the current version. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, TS)] -#[ts(export, export_to = "v3/")] -pub struct SchemaVersion(#[ts(type = "3")] u16); +// +// The text above is the v3 binding's doc, and `bindings/v3/SchemaVersion.ts` +// carries it verbatim (see `V3_TS_DOCS`). One type serves every generation: +// `V` is the wire version, and `v3::SchemaVersion` / `v4::SchemaVersion` name +// `SchemaVersion<3>` / `SchemaVersion<4>`. Plain `SchemaVersion` defaults to +// v3, the version this crate released it as. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize)] +pub struct SchemaVersion(u16); -impl SchemaVersion { - /// The current (only) wire version, `3`. - pub const CURRENT: Self = Self(EQL_SCHEMA_VERSION); +impl SchemaVersion { + /// The only wire version this type admits, `V`. + pub const CURRENT: Self = Self(V); /// The wire value. pub const fn get(self) -> u16 { @@ -75,33 +81,36 @@ impl SchemaVersion { } } -impl Default for SchemaVersion { +impl Default for SchemaVersion { fn default() -> Self { Self::CURRENT } } -impl<'de> Deserialize<'de> for SchemaVersion { +impl<'de, const V: u16> Deserialize<'de> for SchemaVersion { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, { let v = u16::deserialize(deserializer)?; - if v == EQL_SCHEMA_VERSION { + if v == V { Ok(Self(v)) } else { Err(serde::de::Error::custom(format!( - "unsupported EQL schema version {v} (expected {EQL_SCHEMA_VERSION})" + "unsupported EQL schema version {v} (expected {V})" ))) } } } -/// Manual schema: pins `v` to the literal `3` (`const`), mirroring the +/// Manual schema: pins `v` to the literal `V` (`const`), mirroring the /// domain CHECK — the derive would emit an unconstrained integer. -impl schemars::JsonSchema for SchemaVersion { +impl schemars::JsonSchema for SchemaVersion { fn schema_name() -> std::borrow::Cow<'static, str> { - "SchemaVersion".into() + match V { + EQL_SCHEMA_VERSION => "SchemaVersion".into(), + _ => format!("SchemaVersionV{V}").into(), + } } fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema { @@ -111,12 +120,72 @@ impl schemars::JsonSchema for SchemaVersion { // must be updated alongside it. schemars::json_schema!({ "type": "integer", - "const": EQL_SCHEMA_VERSION, - "description": "The envelope version field (`v`) — always exactly `3` on the wire.", + "const": V, + "description": format!("The envelope version field (`v`) — always exactly `{V}` on the wire."), }) } } +/// The JSDoc block of `bindings/v3/SchemaVersion.ts`: the doc comment on +/// [`SchemaVersion`], as ts-rs's derive would have written it. KEEP IN SYNC. +const V3_TS_DOCS: &str = "/**\n \ + * The envelope version field (`v`) — always exactly [`EQL_SCHEMA_VERSION`]\n \ + * on the wire.\n \ + *\n \ + * Deserialization rejects any other value: the Rust analogue of the domain\n \ + * CHECK's `VALUE->>'v' = '3'`, so a wrong-version payload fails at the type\n \ + * boundary instead of at INSERT. The inner value is private; the only\n \ + * constructible instance is the current version.\n \ + */\n"; + +/// Manual TypeScript binding: ts-rs's derive has no const generics. Each +/// version is the literal type `V`; only v3's is exported, as +/// `bindings/v3/SchemaVersion.ts` (`export type SchemaVersion = 3;`). +impl TS for SchemaVersion { + type WithoutGenerics = Self; + const DOCS: Option<&'static str> = if V == EQL_SCHEMA_VERSION { + Some(V3_TS_DOCS) + } else { + None + }; + + fn name() -> String { + match V { + EQL_SCHEMA_VERSION => "SchemaVersion".into(), + _ => format!("SchemaVersionV{V}"), + } + } + + fn inline() -> String { + V.to_string() + } + + fn inline_flattened() -> String { + panic!("{} cannot be flattened", Self::name()) + } + + fn decl() -> String { + format!("type {} = {V};", Self::name()) + } + + fn decl_concrete() -> String { + Self::decl() + } + + fn output_path() -> Option<&'static std::path::Path> { + match V { + EQL_SCHEMA_VERSION => Some(std::path::Path::new("v3/SchemaVersion.ts")), + _ => None, + } + } +} + +#[cfg(test)] +#[test] +fn export_bindings_schemaversion() { + ::export_all().expect("could not export type"); +} + /// Table + column identifier — wire shape `{"t": "...", "c": "..."}`. /// /// Shared by every payload. diff --git a/packages/eql/crates/eql-bindings/src/v3/bigint.rs b/packages/eql/crates/eql-bindings/src/v3/bigint.rs index cf9b64b1b..e1b7e1f8a 100644 --- a/packages/eql/crates/eql-bindings/src/v3/bigint.rs +++ b/packages/eql/crates/eql-bindings/src/v3/bigint.rs @@ -1,8 +1,8 @@ // @generated by eql-codegen from the eql-domains catalog — do not edit //! The `bigint` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{Ciphertext, Hmac256, OpeCllw, OreBlock256}; -use crate::v3::DomainType; -use crate::{Identifier, SchemaVersion}; +use crate::v3::{DomainType, SchemaVersion}; +use crate::Identifier; use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; diff --git a/packages/eql/crates/eql-bindings/src/v3/boolean.rs b/packages/eql/crates/eql-bindings/src/v3/boolean.rs index 98eb74eb9..5025cb274 100644 --- a/packages/eql/crates/eql-bindings/src/v3/boolean.rs +++ b/packages/eql/crates/eql-bindings/src/v3/boolean.rs @@ -1,8 +1,8 @@ // @generated by eql-codegen from the eql-domains catalog — do not edit //! The `boolean` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::Ciphertext; -use crate::v3::DomainType; -use crate::{Identifier, SchemaVersion}; +use crate::v3::{DomainType, SchemaVersion}; +use crate::Identifier; use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; diff --git a/packages/eql/crates/eql-bindings/src/v3/date.rs b/packages/eql/crates/eql-bindings/src/v3/date.rs index 1c112e073..4bd2df73f 100644 --- a/packages/eql/crates/eql-bindings/src/v3/date.rs +++ b/packages/eql/crates/eql-bindings/src/v3/date.rs @@ -1,8 +1,8 @@ // @generated by eql-codegen from the eql-domains catalog — do not edit //! The `date` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{Ciphertext, Hmac256, OpeCllw, OreBlock256}; -use crate::v3::DomainType; -use crate::{Identifier, SchemaVersion}; +use crate::v3::{DomainType, SchemaVersion}; +use crate::Identifier; use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; diff --git a/packages/eql/crates/eql-bindings/src/v3/domain_type.rs b/packages/eql/crates/eql-bindings/src/v3/domain_type.rs index b60151809..ef806a23a 100644 --- a/packages/eql/crates/eql-bindings/src/v3/domain_type.rs +++ b/packages/eql/crates/eql-bindings/src/v3/domain_type.rs @@ -70,6 +70,19 @@ pub trait DomainType { format!("{SCHEMA_ID_BASE}{}.json", self.domain()) } + /// The base [`Self::schema_id`] is built on: [`SCHEMA_ID_BASE`] for v3, + /// overridden by the generated v4 types. The type-level form, so the + /// `PhantomData` handles [`all`](super::all) boxes can reach a type's own + /// base; without it they fell back to the v3 default. + /// + /// `where Self: Sized` keeps the trait object-safe. + fn schema_id_base_static() -> &'static str + where + Self: Sized, + { + SCHEMA_ID_BASE + } + /// Required term JSON keys of this domain beyond the envelope /// (`hm`/`ob`/`bf`/`op`), in catalog (wire) order. `Some(&[])` for a /// storage-only scalar; `None` for the SteVec (jsonb) shapes, whose index @@ -132,6 +145,14 @@ where T::term_json_keys_static() } + fn schema_id_base_static() -> &'static str { + T::schema_id_base_static() + } + + fn schema_id(&self) -> String { + format!("{}{}.json", T::schema_id_base_static(), self.domain()) + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { T::deserialize(value).map(|_| ()) } diff --git a/packages/eql/crates/eql-bindings/src/v3/double.rs b/packages/eql/crates/eql-bindings/src/v3/double.rs index d45cf48a4..36e7c099d 100644 --- a/packages/eql/crates/eql-bindings/src/v3/double.rs +++ b/packages/eql/crates/eql-bindings/src/v3/double.rs @@ -1,8 +1,8 @@ // @generated by eql-codegen from the eql-domains catalog — do not edit //! The `double` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{Ciphertext, Hmac256, OpeCllw, OreBlock256}; -use crate::v3::DomainType; -use crate::{Identifier, SchemaVersion}; +use crate::v3::{DomainType, SchemaVersion}; +use crate::Identifier; use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; diff --git a/packages/eql/crates/eql-bindings/src/v3/integer.rs b/packages/eql/crates/eql-bindings/src/v3/integer.rs index 19ad4516e..228c39dbb 100644 --- a/packages/eql/crates/eql-bindings/src/v3/integer.rs +++ b/packages/eql/crates/eql-bindings/src/v3/integer.rs @@ -1,8 +1,8 @@ // @generated by eql-codegen from the eql-domains catalog — do not edit //! The `integer` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{Ciphertext, Hmac256, OpeCllw, OreBlock256}; -use crate::v3::DomainType; -use crate::{Identifier, SchemaVersion}; +use crate::v3::{DomainType, SchemaVersion}; +use crate::Identifier; use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; diff --git a/packages/eql/crates/eql-bindings/src/v3/json_storage.rs b/packages/eql/crates/eql-bindings/src/v3/json_storage.rs index 7b2a06357..78194984e 100644 --- a/packages/eql/crates/eql-bindings/src/v3/json_storage.rs +++ b/packages/eql/crates/eql-bindings/src/v3/json_storage.rs @@ -1,8 +1,8 @@ // @generated by eql-codegen from the eql-domains catalog — do not edit //! The generated scalar (storage) domain(s) of the `json` encrypted-domain family — generated from the eql-domains catalog. The family's SteVec domains are hand-written in `json.rs`. use crate::v3::terms::Ciphertext; -use crate::v3::DomainType; -use crate::{Identifier, SchemaVersion}; +use crate::v3::{DomainType, SchemaVersion}; +use crate::Identifier; use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; diff --git a/packages/eql/crates/eql-bindings/src/v3/mod.rs b/packages/eql/crates/eql-bindings/src/v3/mod.rs index a23094056..456822802 100644 --- a/packages/eql/crates/eql-bindings/src/v3/mod.rs +++ b/packages/eql/crates/eql-bindings/src/v3/mod.rs @@ -142,18 +142,12 @@ pub mod payload; pub mod query_payload; pub mod real; pub mod smallint; -/// Generated: the table of EQL types a Stack Encrypt data plan may name as -/// a field target (`TARGETS`) and the by-name dispatch that runs a -/// producible type's own plan. Only meaningful with the engine, so it is -/// gated here, in the hand-written module list, rather than inside the -/// generated file. The descriptor type, the errors and the public entry -/// points are hand-written in [`crate::encryption::targets`]. -#[cfg(feature = "stack-encrypt")] -pub mod targets; pub mod terms; pub mod text; pub mod timestamp; +/// The envelope version field of a v3 payload: always `3`. +pub type SchemaVersion = crate::SchemaVersion<{ crate::EQL_SCHEMA_VERSION }>; pub use domain_type::{DomainType, SCHEMA_ID_BASE, SQL_SCHEMA}; pub use inventory::{all, all_query}; pub use payload::DomainPayload; diff --git a/packages/eql/crates/eql-bindings/src/v3/numeric.rs b/packages/eql/crates/eql-bindings/src/v3/numeric.rs index 835b322cf..238a95a0a 100644 --- a/packages/eql/crates/eql-bindings/src/v3/numeric.rs +++ b/packages/eql/crates/eql-bindings/src/v3/numeric.rs @@ -1,8 +1,8 @@ // @generated by eql-codegen from the eql-domains catalog — do not edit //! The `numeric` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{Ciphertext, Hmac256, OpeCllw, OreBlock256}; -use crate::v3::DomainType; -use crate::{Identifier, SchemaVersion}; +use crate::v3::{DomainType, SchemaVersion}; +use crate::Identifier; use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; diff --git a/packages/eql/crates/eql-bindings/src/v3/real.rs b/packages/eql/crates/eql-bindings/src/v3/real.rs index a118fdff9..2394dfcc5 100644 --- a/packages/eql/crates/eql-bindings/src/v3/real.rs +++ b/packages/eql/crates/eql-bindings/src/v3/real.rs @@ -1,8 +1,8 @@ // @generated by eql-codegen from the eql-domains catalog — do not edit //! The `real` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{Ciphertext, Hmac256, OpeCllw, OreBlock256}; -use crate::v3::DomainType; -use crate::{Identifier, SchemaVersion}; +use crate::v3::{DomainType, SchemaVersion}; +use crate::Identifier; use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; diff --git a/packages/eql/crates/eql-bindings/src/v3/smallint.rs b/packages/eql/crates/eql-bindings/src/v3/smallint.rs index fe69cfaec..f3fc9e112 100644 --- a/packages/eql/crates/eql-bindings/src/v3/smallint.rs +++ b/packages/eql/crates/eql-bindings/src/v3/smallint.rs @@ -1,8 +1,8 @@ // @generated by eql-codegen from the eql-domains catalog — do not edit //! The `smallint` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{Ciphertext, Hmac256, OpeCllw, OreBlock256}; -use crate::v3::DomainType; -use crate::{Identifier, SchemaVersion}; +use crate::v3::{DomainType, SchemaVersion}; +use crate::Identifier; use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; diff --git a/packages/eql/crates/eql-bindings/src/v3/text.rs b/packages/eql/crates/eql-bindings/src/v3/text.rs index 382af2096..31944d934 100644 --- a/packages/eql/crates/eql-bindings/src/v3/text.rs +++ b/packages/eql/crates/eql-bindings/src/v3/text.rs @@ -1,8 +1,8 @@ // @generated by eql-codegen from the eql-domains catalog — do not edit //! The `text` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{BloomFilter, Ciphertext, Hmac256, OpeCllw, OreBlock256}; -use crate::v3::DomainType; -use crate::{Identifier, SchemaVersion}; +use crate::v3::{DomainType, SchemaVersion}; +use crate::Identifier; use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; @@ -50,29 +50,11 @@ impl DomainType for Text { doc, doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." )] -#[cfg_attr(doc, doc = "")] -#[cfg_attr( - doc, - doc = " Plaintext input and decrypted output: [`String`]. With the `stack-encrypt` feature, implements `EncryptFrom` and `DecryptInto`." -)] -#[cfg_attr( - all(doc, feature = "stack-encrypt"), - doc = " Encryption context: `NonEmpty`, constructed with `Identifier::for_column(table, column)` and stored in `i`." -)] -#[cfg_attr( - all(doc, feature = "stack-encrypt"), - doc = " See the [complete encryption example](crate::encryption#example)." -)] -#[cfg_attr(feature = "stack-encrypt", derive(stack_encrypt::EncryptFrom))] -#[cfg_attr(feature = "stack-encrypt", derive(stack_encrypt::DecryptInto))] -#[cfg_attr(feature = "stack-encrypt", stash(plaintext = String))] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct TextEq { - #[cfg_attr(feature = "stack-encrypt", stash(default))] pub v: SchemaVersion, - #[cfg_attr(feature = "stack-encrypt", stash(context_field))] pub i: Identifier, pub c: Ciphertext, pub hm: Hmac256, @@ -334,28 +316,11 @@ impl DomainType for TextSearch { doc, doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." )] -#[cfg_attr(doc, doc = "")] -#[cfg_attr( - doc, - doc = " Plaintext input: [`String`]. With the `stack-encrypt` feature, implements `EncryptFrom` to build equality query terms. Query operands do not decrypt." -)] -#[cfg_attr( - all(doc, feature = "stack-encrypt"), - doc = " Encryption context: `NonEmpty`, constructed with `Identifier::for_column(table, column)` and stored in `i`." -)] -#[cfg_attr( - all(doc, feature = "stack-encrypt"), - doc = " See the [complete encryption example](crate::encryption#example)." -)] -#[cfg_attr(feature = "stack-encrypt", derive(stack_encrypt::EncryptFrom))] -#[cfg_attr(feature = "stack-encrypt", stash(plaintext = String))] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] #[ts(export, export_to = "v3/")] #[serde(deny_unknown_fields)] pub struct TextEqQuery { - #[cfg_attr(feature = "stack-encrypt", stash(default))] pub v: SchemaVersion, - #[cfg_attr(feature = "stack-encrypt", stash(context_field))] pub i: Identifier, pub hm: Hmac256, } diff --git a/packages/eql/crates/eql-bindings/src/v3/timestamp.rs b/packages/eql/crates/eql-bindings/src/v3/timestamp.rs index de022873d..d26be5d69 100644 --- a/packages/eql/crates/eql-bindings/src/v3/timestamp.rs +++ b/packages/eql/crates/eql-bindings/src/v3/timestamp.rs @@ -1,8 +1,8 @@ // @generated by eql-codegen from the eql-domains catalog — do not edit //! The `timestamp` encrypted-domain family — generated from the eql-domains catalog. use crate::v3::terms::{Ciphertext, Hmac256, OpeCllw, OreBlock256}; -use crate::v3::DomainType; -use crate::{Identifier, SchemaVersion}; +use crate::v3::{DomainType, SchemaVersion}; +use crate::Identifier; use schemars::{schema_for, JsonSchema, Schema}; use serde::{Deserialize, Serialize}; use ts_rs::TS; diff --git a/packages/eql/crates/eql-bindings/src/v4/bigint.rs b/packages/eql/crates/eql-bindings/src/v4/bigint.rs new file mode 100644 index 000000000..98e4aa73a --- /dev/null +++ b/packages/eql/crates/eql-bindings/src/v4/bigint.rs @@ -0,0 +1,381 @@ +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `bigint` encrypted-domain family — generated from the eql-domains catalog. +use crate::v4::terms::{Ciphertext, Hmac256, OpeCllw, OreBlock256}; +use crate::v4::{DomainType, SchemaVersion}; +use crate::Identifier; +use schemars::{schema_for, JsonSchema, Schema}; +use serde::{Deserialize, Serialize}; +use ts_rs::TS; +/// `public.eql_v4_bigint` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL bigint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct Bigint { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, +} +impl DomainType for Bigint { + fn sql_domain_static() -> &'static str { + "public.eql_v4_bigint" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&[]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + Bigint::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(Bigint) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_bigint_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL bigint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct BigintEq { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub hm: Hmac256, +} +impl DomainType for BigintEq { + fn sql_domain_static() -> &'static str { + "public.eql_v4_bigint_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + BigintEq::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(BigintEq) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_bigint_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL bigint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct BigintOrdOre { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub ob: OreBlock256, +} +impl DomainType for BigintOrdOre { + fn sql_domain_static() -> &'static str { + "public.eql_v4_bigint_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + BigintOrdOre::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(BigintOrdOre) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_bigint_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL bigint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct BigintOrd { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub op: OpeCllw, +} +impl DomainType for BigintOrd { + fn sql_domain_static() -> &'static str { + "public.eql_v4_bigint_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + BigintOrd::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(BigintOrd) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_bigint_ord_ope` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL bigint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct BigintOrdOpe { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub op: OpeCllw, +} +impl DomainType for BigintOrdOpe { + fn sql_domain_static() -> &'static str { + "public.eql_v4_bigint_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + BigintOrdOpe::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(BigintOrdOpe) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_bigint_eq` — equality domain query operand. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL bigint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct BigintEqQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub hm: Hmac256, +} +impl DomainType for BigintEqQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_bigint_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + BigintEqQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(BigintEqQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_bigint_ord_ore` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL bigint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct BigintOrdOreQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub ob: OreBlock256, +} +impl DomainType for BigintOrdOreQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_bigint_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + BigintOrdOreQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(BigintOrdOreQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_bigint_ord` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL bigint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct BigintOrdQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub op: OpeCllw, +} +impl DomainType for BigintOrdQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_bigint_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + BigintOrdQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(BigintOrdQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_bigint_ord_ope` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL bigint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct BigintOrdOpeQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub op: OpeCllw, +} +impl DomainType for BigintOrdOpeQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_bigint_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + BigintOrdOpeQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(BigintOrdOpeQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} diff --git a/packages/eql/crates/eql-bindings/src/v4/boolean.rs b/packages/eql/crates/eql-bindings/src/v4/boolean.rs new file mode 100644 index 000000000..ca4a1c71a --- /dev/null +++ b/packages/eql/crates/eql-bindings/src/v4/boolean.rs @@ -0,0 +1,49 @@ +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `boolean` encrypted-domain family — generated from the eql-domains catalog. +use crate::v4::terms::Ciphertext; +use crate::v4::{DomainType, SchemaVersion}; +use crate::Identifier; +use schemars::{schema_for, JsonSchema, Schema}; +use serde::{Deserialize, Serialize}; +use ts_rs::TS; +/// `public.eql_v4_boolean` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL boolean reference](https://cipherstash.com/docs/reference/eql/booleans) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct Boolean { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, +} +impl DomainType for Boolean { + fn sql_domain_static() -> &'static str { + "public.eql_v4_boolean" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&[]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + Boolean::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(Boolean) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} diff --git a/packages/eql/crates/eql-bindings/src/v4/date.rs b/packages/eql/crates/eql-bindings/src/v4/date.rs new file mode 100644 index 000000000..f704939bb --- /dev/null +++ b/packages/eql/crates/eql-bindings/src/v4/date.rs @@ -0,0 +1,381 @@ +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `date` encrypted-domain family — generated from the eql-domains catalog. +use crate::v4::terms::{Ciphertext, Hmac256, OpeCllw, OreBlock256}; +use crate::v4::{DomainType, SchemaVersion}; +use crate::Identifier; +use schemars::{schema_for, JsonSchema, Schema}; +use serde::{Deserialize, Serialize}; +use ts_rs::TS; +/// `public.eql_v4_date` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL date reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct Date { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, +} +impl DomainType for Date { + fn sql_domain_static() -> &'static str { + "public.eql_v4_date" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&[]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + Date::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(Date) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_date_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL date reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct DateEq { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub hm: Hmac256, +} +impl DomainType for DateEq { + fn sql_domain_static() -> &'static str { + "public.eql_v4_date_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + DateEq::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(DateEq) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_date_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL date reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct DateOrdOre { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub ob: OreBlock256, +} +impl DomainType for DateOrdOre { + fn sql_domain_static() -> &'static str { + "public.eql_v4_date_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + DateOrdOre::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(DateOrdOre) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_date_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL date reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct DateOrd { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub op: OpeCllw, +} +impl DomainType for DateOrd { + fn sql_domain_static() -> &'static str { + "public.eql_v4_date_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + DateOrd::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(DateOrd) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_date_ord_ope` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL date reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct DateOrdOpe { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub op: OpeCllw, +} +impl DomainType for DateOrdOpe { + fn sql_domain_static() -> &'static str { + "public.eql_v4_date_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + DateOrdOpe::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(DateOrdOpe) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_date_eq` — equality domain query operand. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL date reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct DateEqQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub hm: Hmac256, +} +impl DomainType for DateEqQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_date_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + DateEqQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(DateEqQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_date_ord_ore` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL date reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct DateOrdOreQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub ob: OreBlock256, +} +impl DomainType for DateOrdOreQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_date_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + DateOrdOreQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(DateOrdOreQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_date_ord` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL date reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct DateOrdQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub op: OpeCllw, +} +impl DomainType for DateOrdQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_date_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + DateOrdQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(DateOrdQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_date_ord_ope` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL date reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct DateOrdOpeQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub op: OpeCllw, +} +impl DomainType for DateOrdOpeQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_date_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + DateOrdOpeQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(DateOrdOpeQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} diff --git a/packages/eql/crates/eql-bindings/src/v4/double.rs b/packages/eql/crates/eql-bindings/src/v4/double.rs new file mode 100644 index 000000000..bd73e4043 --- /dev/null +++ b/packages/eql/crates/eql-bindings/src/v4/double.rs @@ -0,0 +1,381 @@ +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `double` encrypted-domain family — generated from the eql-domains catalog. +use crate::v4::terms::{Ciphertext, Hmac256, OpeCllw, OreBlock256}; +use crate::v4::{DomainType, SchemaVersion}; +use crate::Identifier; +use schemars::{schema_for, JsonSchema, Schema}; +use serde::{Deserialize, Serialize}; +use ts_rs::TS; +/// `public.eql_v4_double` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL double reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct Double { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, +} +impl DomainType for Double { + fn sql_domain_static() -> &'static str { + "public.eql_v4_double" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&[]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + Double::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(Double) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_double_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL double reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct DoubleEq { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub hm: Hmac256, +} +impl DomainType for DoubleEq { + fn sql_domain_static() -> &'static str { + "public.eql_v4_double_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + DoubleEq::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(DoubleEq) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_double_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL double reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct DoubleOrdOre { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub ob: OreBlock256, +} +impl DomainType for DoubleOrdOre { + fn sql_domain_static() -> &'static str { + "public.eql_v4_double_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + DoubleOrdOre::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(DoubleOrdOre) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_double_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL double reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct DoubleOrd { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub op: OpeCllw, +} +impl DomainType for DoubleOrd { + fn sql_domain_static() -> &'static str { + "public.eql_v4_double_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + DoubleOrd::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(DoubleOrd) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_double_ord_ope` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL double reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct DoubleOrdOpe { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub op: OpeCllw, +} +impl DomainType for DoubleOrdOpe { + fn sql_domain_static() -> &'static str { + "public.eql_v4_double_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + DoubleOrdOpe::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(DoubleOrdOpe) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_double_eq` — equality domain query operand. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL double reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct DoubleEqQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub hm: Hmac256, +} +impl DomainType for DoubleEqQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_double_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + DoubleEqQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(DoubleEqQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_double_ord_ore` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL double reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct DoubleOrdOreQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub ob: OreBlock256, +} +impl DomainType for DoubleOrdOreQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_double_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + DoubleOrdOreQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(DoubleOrdOreQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_double_ord` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL double reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct DoubleOrdQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub op: OpeCllw, +} +impl DomainType for DoubleOrdQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_double_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + DoubleOrdQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(DoubleOrdQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_double_ord_ope` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL double reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct DoubleOrdOpeQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub op: OpeCllw, +} +impl DomainType for DoubleOrdOpeQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_double_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + DoubleOrdOpeQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(DoubleOrdOpeQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} diff --git a/packages/eql/crates/eql-bindings/src/v4/integer.rs b/packages/eql/crates/eql-bindings/src/v4/integer.rs new file mode 100644 index 000000000..f320c8794 --- /dev/null +++ b/packages/eql/crates/eql-bindings/src/v4/integer.rs @@ -0,0 +1,381 @@ +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `integer` encrypted-domain family — generated from the eql-domains catalog. +use crate::v4::terms::{Ciphertext, Hmac256, OpeCllw, OreBlock256}; +use crate::v4::{DomainType, SchemaVersion}; +use crate::Identifier; +use schemars::{schema_for, JsonSchema, Schema}; +use serde::{Deserialize, Serialize}; +use ts_rs::TS; +/// `public.eql_v4_integer` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL integer reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct Integer { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, +} +impl DomainType for Integer { + fn sql_domain_static() -> &'static str { + "public.eql_v4_integer" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&[]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + Integer::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(Integer) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_integer_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL integer reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct IntegerEq { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub hm: Hmac256, +} +impl DomainType for IntegerEq { + fn sql_domain_static() -> &'static str { + "public.eql_v4_integer_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + IntegerEq::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(IntegerEq) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_integer_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL integer reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct IntegerOrdOre { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub ob: OreBlock256, +} +impl DomainType for IntegerOrdOre { + fn sql_domain_static() -> &'static str { + "public.eql_v4_integer_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + IntegerOrdOre::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(IntegerOrdOre) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_integer_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL integer reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct IntegerOrd { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub op: OpeCllw, +} +impl DomainType for IntegerOrd { + fn sql_domain_static() -> &'static str { + "public.eql_v4_integer_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + IntegerOrd::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(IntegerOrd) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_integer_ord_ope` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL integer reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct IntegerOrdOpe { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub op: OpeCllw, +} +impl DomainType for IntegerOrdOpe { + fn sql_domain_static() -> &'static str { + "public.eql_v4_integer_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + IntegerOrdOpe::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(IntegerOrdOpe) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_integer_eq` — equality domain query operand. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL integer reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct IntegerEqQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub hm: Hmac256, +} +impl DomainType for IntegerEqQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_integer_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + IntegerEqQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(IntegerEqQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_integer_ord_ore` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL integer reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct IntegerOrdOreQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub ob: OreBlock256, +} +impl DomainType for IntegerOrdOreQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_integer_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + IntegerOrdOreQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(IntegerOrdOreQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_integer_ord` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL integer reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct IntegerOrdQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub op: OpeCllw, +} +impl DomainType for IntegerOrdQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_integer_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + IntegerOrdQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(IntegerOrdQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_integer_ord_ope` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL integer reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct IntegerOrdOpeQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub op: OpeCllw, +} +impl DomainType for IntegerOrdOpeQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_integer_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + IntegerOrdOpeQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(IntegerOrdOpeQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} diff --git a/packages/eql/crates/eql-bindings/src/v4/inventory.rs b/packages/eql/crates/eql-bindings/src/v4/inventory.rs new file mode 100644 index 000000000..0e8fc7f53 --- /dev/null +++ b/packages/eql/crates/eql-bindings/src/v4/inventory.rs @@ -0,0 +1,105 @@ +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `all()` / `all_query()` inventories — every v4 stored and query-operand payload type in eql-domains::CATALOG order. Generated from the catalog. +use super::DomainType; +use std::marker::PhantomData; +/// Every v4 stored-payload domain type, in `eql-domains::CATALOG` +/// order — generated. Scalar domains only: v4 has no SteVec bindings. +pub fn all() -> Vec> { + vec![ + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + ] +} +/// Every v4 QUERY-operand twin (`eql_v4.query_`), in +/// `eql-domains::CATALOG` order — generated. +pub fn all_query() -> Vec> { + vec![ + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + Box::new(PhantomData::), + ] +} diff --git a/packages/eql/crates/eql-bindings/src/v4/json.rs b/packages/eql/crates/eql-bindings/src/v4/json.rs new file mode 100644 index 000000000..b88be1408 --- /dev/null +++ b/packages/eql/crates/eql-bindings/src/v4/json.rs @@ -0,0 +1,49 @@ +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The generated scalar (storage) domain(s) of the `json` encrypted-domain family — generated from the eql-domains catalog. EQL v4 has no SteVec bindings yet. +use crate::v4::terms::Ciphertext; +use crate::v4::{DomainType, SchemaVersion}; +use crate::Identifier; +use schemars::{schema_for, JsonSchema, Schema}; +use serde::{Deserialize, Serialize}; +use ts_rs::TS; +/// `public.eql_v4_json` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL JSON reference](https://cipherstash.com/docs/reference/eql/json) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct Json { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, +} +impl DomainType for Json { + fn sql_domain_static() -> &'static str { + "public.eql_v4_json" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&[]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + Json::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(Json) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} diff --git a/packages/eql/crates/eql-bindings/src/v4/mod.rs b/packages/eql/crates/eql-bindings/src/v4/mod.rs new file mode 100644 index 000000000..8fca2436d --- /dev/null +++ b/packages/eql/crates/eql-bindings/src/v4/mod.rs @@ -0,0 +1,65 @@ +//! # `eql_v4` domain payload types +//! +//! EQL v4 is the v3 SQL installed under a second name (ADR-0002): `eql_v3` +//! holds terms written by cipherstash-client, `eql_v4` holds terms written by +//! Stack Encrypt. The structs here are generated from the same catalog as +//! [`crate::v3`], with `eql_v4_*` domain names and a `v` of `4`. +//! +//! **Only these structs derive Stack Encrypt's traits** (`EncryptFrom`, +//! `DecryptInto`, behind the `stack-encrypt` feature). Stack Encrypt's output +//! is not byte-for-byte compatible with cipherstash-client's, so no `eql_v3` +//! struct claims it. Which v4 types derive them is +//! `eql-codegen`'s `ENCRYPTION_DOMAINS`; the rest say why in +//! `crate::encryption::targets`. +//! +//! v4 has no SteVec bindings, payload enums, TypeScript export or +//! published JSON Schema yet; those follow in `@cipherstash/eql` 4.0. The +//! term newtypes and the [`DomainType`] trait are shared with v3: a v4 +//! `Ciphertext` or `Hmac256` is v3's type, so a change to a term's validation +//! in `v3::terms` changes v4 too. What separates the two on the wire is the +//! envelope's [`SchemaVersion`], which refuses the other generation's `v`. + +pub mod bigint; +pub mod boolean; +pub mod date; +pub mod double; +pub mod integer; +pub mod inventory; +/// Generated bindings for the `json` family's bare scalar storage domain +/// (`public.eql_v4_json`, the `Json` struct). +pub mod json; +pub mod numeric; +pub mod real; +pub mod smallint; +/// Generated: the table of EQL types a Stack Encrypt data plan may name as +/// a field target (`TARGETS`) and the by-name dispatch that runs a +/// producible type's own plan. Gated here, in the hand-written module list, +/// rather than inside the generated file. The descriptor type, the errors +/// and the public entry points are hand-written in +/// [`crate::encryption::targets`]. +#[cfg(feature = "stack-encrypt")] +pub mod targets; +pub mod text; +pub mod timestamp; + +pub use crate::v3::domain_type::{DomainType, SQL_SCHEMA}; +pub use crate::v3::terms; +pub use inventory::{all, all_query}; + +/// The PostgreSQL typname prefix every `public` v4 domain carries. +pub const PUBLIC_TYPNAME_PREFIX: &str = "eql_v4_"; + +/// Base URL for the canonical `$id` of a v4 domain's JSON Schema. +pub const SCHEMA_ID_BASE: &str = "https://schemas.cipherstash.com/eql/v4/"; + +/// EQL v4 wire-format version: the `v` every v4 payload carries, and what the +/// `eql_v4_*` domain CHECKs assert. +pub const EQL_SCHEMA_VERSION: u16 = 4; + +/// The envelope version field (`v`) of a v4 payload — always exactly +/// [`EQL_SCHEMA_VERSION`] on the wire. +/// +/// Deserialization rejects any other value, so a v3 payload fails at the type +/// boundary instead of at INSERT. The same type as v3's, at version `4`: see +/// [`crate::SchemaVersion`]. +pub type SchemaVersion = crate::SchemaVersion; diff --git a/packages/eql/crates/eql-bindings/src/v4/numeric.rs b/packages/eql/crates/eql-bindings/src/v4/numeric.rs new file mode 100644 index 000000000..ff46246d4 --- /dev/null +++ b/packages/eql/crates/eql-bindings/src/v4/numeric.rs @@ -0,0 +1,381 @@ +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `numeric` encrypted-domain family — generated from the eql-domains catalog. +use crate::v4::terms::{Ciphertext, Hmac256, OpeCllw, OreBlock256}; +use crate::v4::{DomainType, SchemaVersion}; +use crate::Identifier; +use schemars::{schema_for, JsonSchema, Schema}; +use serde::{Deserialize, Serialize}; +use ts_rs::TS; +/// `public.eql_v4_numeric` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL numeric reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct Numeric { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, +} +impl DomainType for Numeric { + fn sql_domain_static() -> &'static str { + "public.eql_v4_numeric" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&[]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + Numeric::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(Numeric) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_numeric_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL numeric reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct NumericEq { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub hm: Hmac256, +} +impl DomainType for NumericEq { + fn sql_domain_static() -> &'static str { + "public.eql_v4_numeric_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + NumericEq::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(NumericEq) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_numeric_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL numeric reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct NumericOrdOre { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub ob: OreBlock256, +} +impl DomainType for NumericOrdOre { + fn sql_domain_static() -> &'static str { + "public.eql_v4_numeric_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + NumericOrdOre::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(NumericOrdOre) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_numeric_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL numeric reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct NumericOrd { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub op: OpeCllw, +} +impl DomainType for NumericOrd { + fn sql_domain_static() -> &'static str { + "public.eql_v4_numeric_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + NumericOrd::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(NumericOrd) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_numeric_ord_ope` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL numeric reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct NumericOrdOpe { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub op: OpeCllw, +} +impl DomainType for NumericOrdOpe { + fn sql_domain_static() -> &'static str { + "public.eql_v4_numeric_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + NumericOrdOpe::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(NumericOrdOpe) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_numeric_eq` — equality domain query operand. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL numeric reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct NumericEqQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub hm: Hmac256, +} +impl DomainType for NumericEqQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_numeric_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + NumericEqQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(NumericEqQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_numeric_ord_ore` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL numeric reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct NumericOrdOreQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub ob: OreBlock256, +} +impl DomainType for NumericOrdOreQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_numeric_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + NumericOrdOreQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(NumericOrdOreQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_numeric_ord` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL numeric reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct NumericOrdQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub op: OpeCllw, +} +impl DomainType for NumericOrdQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_numeric_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + NumericOrdQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(NumericOrdQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_numeric_ord_ope` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL numeric reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct NumericOrdOpeQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub op: OpeCllw, +} +impl DomainType for NumericOrdOpeQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_numeric_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + NumericOrdOpeQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(NumericOrdOpeQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} diff --git a/packages/eql/crates/eql-bindings/src/v4/real.rs b/packages/eql/crates/eql-bindings/src/v4/real.rs new file mode 100644 index 000000000..6d6ef3b88 --- /dev/null +++ b/packages/eql/crates/eql-bindings/src/v4/real.rs @@ -0,0 +1,381 @@ +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `real` encrypted-domain family — generated from the eql-domains catalog. +use crate::v4::terms::{Ciphertext, Hmac256, OpeCllw, OreBlock256}; +use crate::v4::{DomainType, SchemaVersion}; +use crate::Identifier; +use schemars::{schema_for, JsonSchema, Schema}; +use serde::{Deserialize, Serialize}; +use ts_rs::TS; +/// `public.eql_v4_real` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL real reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct Real { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, +} +impl DomainType for Real { + fn sql_domain_static() -> &'static str { + "public.eql_v4_real" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&[]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + Real::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(Real) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_real_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL real reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct RealEq { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub hm: Hmac256, +} +impl DomainType for RealEq { + fn sql_domain_static() -> &'static str { + "public.eql_v4_real_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + RealEq::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(RealEq) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_real_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL real reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct RealOrdOre { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub ob: OreBlock256, +} +impl DomainType for RealOrdOre { + fn sql_domain_static() -> &'static str { + "public.eql_v4_real_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + RealOrdOre::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(RealOrdOre) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_real_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL real reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct RealOrd { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub op: OpeCllw, +} +impl DomainType for RealOrd { + fn sql_domain_static() -> &'static str { + "public.eql_v4_real_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + RealOrd::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(RealOrd) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_real_ord_ope` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL real reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct RealOrdOpe { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub op: OpeCllw, +} +impl DomainType for RealOrdOpe { + fn sql_domain_static() -> &'static str { + "public.eql_v4_real_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + RealOrdOpe::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(RealOrdOpe) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_real_eq` — equality domain query operand. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL real reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct RealEqQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub hm: Hmac256, +} +impl DomainType for RealEqQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_real_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + RealEqQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(RealEqQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_real_ord_ore` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL real reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct RealOrdOreQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub ob: OreBlock256, +} +impl DomainType for RealOrdOreQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_real_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + RealOrdOreQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(RealOrdOreQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_real_ord` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL real reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct RealOrdQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub op: OpeCllw, +} +impl DomainType for RealOrdQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_real_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + RealOrdQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(RealOrdQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_real_ord_ope` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL real reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct RealOrdOpeQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub op: OpeCllw, +} +impl DomainType for RealOrdOpeQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_real_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + RealOrdOpeQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(RealOrdOpeQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} diff --git a/packages/eql/crates/eql-bindings/src/v4/smallint.rs b/packages/eql/crates/eql-bindings/src/v4/smallint.rs new file mode 100644 index 000000000..5341a7810 --- /dev/null +++ b/packages/eql/crates/eql-bindings/src/v4/smallint.rs @@ -0,0 +1,381 @@ +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `smallint` encrypted-domain family — generated from the eql-domains catalog. +use crate::v4::terms::{Ciphertext, Hmac256, OpeCllw, OreBlock256}; +use crate::v4::{DomainType, SchemaVersion}; +use crate::Identifier; +use schemars::{schema_for, JsonSchema, Schema}; +use serde::{Deserialize, Serialize}; +use ts_rs::TS; +/// `public.eql_v4_smallint` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL smallint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct Smallint { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, +} +impl DomainType for Smallint { + fn sql_domain_static() -> &'static str { + "public.eql_v4_smallint" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&[]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + Smallint::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(Smallint) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_smallint_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL smallint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct SmallintEq { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub hm: Hmac256, +} +impl DomainType for SmallintEq { + fn sql_domain_static() -> &'static str { + "public.eql_v4_smallint_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + SmallintEq::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(SmallintEq) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_smallint_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL smallint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct SmallintOrdOre { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub ob: OreBlock256, +} +impl DomainType for SmallintOrdOre { + fn sql_domain_static() -> &'static str { + "public.eql_v4_smallint_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + SmallintOrdOre::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(SmallintOrdOre) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_smallint_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL smallint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct SmallintOrd { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub op: OpeCllw, +} +impl DomainType for SmallintOrd { + fn sql_domain_static() -> &'static str { + "public.eql_v4_smallint_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + SmallintOrd::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(SmallintOrd) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_smallint_ord_ope` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL smallint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct SmallintOrdOpe { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub op: OpeCllw, +} +impl DomainType for SmallintOrdOpe { + fn sql_domain_static() -> &'static str { + "public.eql_v4_smallint_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + SmallintOrdOpe::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(SmallintOrdOpe) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_smallint_eq` — equality domain query operand. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL smallint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct SmallintEqQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub hm: Hmac256, +} +impl DomainType for SmallintEqQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_smallint_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + SmallintEqQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(SmallintEqQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_smallint_ord_ore` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL smallint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct SmallintOrdOreQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub ob: OreBlock256, +} +impl DomainType for SmallintOrdOreQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_smallint_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + SmallintOrdOreQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(SmallintOrdOreQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_smallint_ord` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL smallint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct SmallintOrdQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub op: OpeCllw, +} +impl DomainType for SmallintOrdQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_smallint_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + SmallintOrdQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(SmallintOrdQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_smallint_ord_ope` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL smallint reference](https://cipherstash.com/docs/reference/eql/numbers) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct SmallintOrdOpeQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub op: OpeCllw, +} +impl DomainType for SmallintOrdOpeQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_smallint_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + SmallintOrdOpeQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(SmallintOrdOpeQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} diff --git a/packages/eql/crates/eql-bindings/src/v3/targets.rs b/packages/eql/crates/eql-bindings/src/v4/targets.rs similarity index 80% rename from packages/eql/crates/eql-bindings/src/v3/targets.rs rename to packages/eql/crates/eql-bindings/src/v4/targets.rs index e767f3715..cfaa39d8b 100644 --- a/packages/eql/crates/eql-bindings/src/v3/targets.rs +++ b/packages/eql/crates/eql-bindings/src/v4/targets.rs @@ -1,5 +1,5 @@ // @generated by eql-codegen from the eql-domains catalog — do not edit -//! The EQL types a Stack Encrypt data plan may name as a field target — every stored v3 domain type in eql-domains::CATALOG order, as data a guest serializes (`TARGETS`), with the by-name dispatch that runs a producible type's own Rust plan. Generated from the catalog; the descriptor type, the errors and the public entry points stay hand-written in `crate::encryption::targets`, which documents the wire format. +//! The EQL types a Stack Encrypt data plan may name as a field target — every stored EQL v4 domain type in eql-domains::CATALOG order, as data a guest serializes (`TARGETS`), with the by-name dispatch that runs a producible type's own Rust plan. Generated from the catalog; the descriptor type, the errors and the public entry points stay hand-written in `crate::encryption::targets`, which documents the wire format. use crate::encryption::targets::{ open_target, refuse, refuse_query, run_target, Opener, Target, TargetError, }; @@ -16,7 +16,7 @@ pub const TARGETS: &[Target] = &[ family: "integer", suffix: "", plaintext: None, - sql_domain: "public.eql_v3_integer", + sql_domain: "public.eql_v4_integer", indexes: &[], query: None, query_sql_domain: None, @@ -30,10 +30,10 @@ pub const TARGETS: &[Target] = &[ family: "integer", suffix: "Eq", plaintext: None, - sql_domain: "public.eql_v3_integer_eq", + sql_domain: "public.eql_v4_integer_eq", indexes: &["eq"], query: Some("IntegerEqQuery"), - query_sql_domain: Some("eql_v3.query_integer_eq"), + query_sql_domain: Some("eql_v4.query_integer_eq"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -44,10 +44,10 @@ pub const TARGETS: &[Target] = &[ family: "integer", suffix: "OrdOre", plaintext: None, - sql_domain: "public.eql_v3_integer_ord_ore", + sql_domain: "public.eql_v4_integer_ord_ore", indexes: &["ore"], query: Some("IntegerOrdOreQuery"), - query_sql_domain: Some("eql_v3.query_integer_ord_ore"), + query_sql_domain: Some("eql_v4.query_integer_ord_ore"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -58,10 +58,10 @@ pub const TARGETS: &[Target] = &[ family: "integer", suffix: "Ord", plaintext: None, - sql_domain: "public.eql_v3_integer_ord", + sql_domain: "public.eql_v4_integer_ord", indexes: &["ope"], query: Some("IntegerOrdQuery"), - query_sql_domain: Some("eql_v3.query_integer_ord"), + query_sql_domain: Some("eql_v4.query_integer_ord"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -72,10 +72,10 @@ pub const TARGETS: &[Target] = &[ family: "integer", suffix: "OrdOpe", plaintext: None, - sql_domain: "public.eql_v3_integer_ord_ope", + sql_domain: "public.eql_v4_integer_ord_ope", indexes: &["ope"], query: Some("IntegerOrdOpeQuery"), - query_sql_domain: Some("eql_v3.query_integer_ord_ope"), + query_sql_domain: Some("eql_v4.query_integer_ord_ope"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -86,7 +86,7 @@ pub const TARGETS: &[Target] = &[ family: "smallint", suffix: "", plaintext: None, - sql_domain: "public.eql_v3_smallint", + sql_domain: "public.eql_v4_smallint", indexes: &[], query: None, query_sql_domain: None, @@ -100,10 +100,10 @@ pub const TARGETS: &[Target] = &[ family: "smallint", suffix: "Eq", plaintext: None, - sql_domain: "public.eql_v3_smallint_eq", + sql_domain: "public.eql_v4_smallint_eq", indexes: &["eq"], query: Some("SmallintEqQuery"), - query_sql_domain: Some("eql_v3.query_smallint_eq"), + query_sql_domain: Some("eql_v4.query_smallint_eq"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -114,10 +114,10 @@ pub const TARGETS: &[Target] = &[ family: "smallint", suffix: "OrdOre", plaintext: None, - sql_domain: "public.eql_v3_smallint_ord_ore", + sql_domain: "public.eql_v4_smallint_ord_ore", indexes: &["ore"], query: Some("SmallintOrdOreQuery"), - query_sql_domain: Some("eql_v3.query_smallint_ord_ore"), + query_sql_domain: Some("eql_v4.query_smallint_ord_ore"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -128,10 +128,10 @@ pub const TARGETS: &[Target] = &[ family: "smallint", suffix: "Ord", plaintext: None, - sql_domain: "public.eql_v3_smallint_ord", + sql_domain: "public.eql_v4_smallint_ord", indexes: &["ope"], query: Some("SmallintOrdQuery"), - query_sql_domain: Some("eql_v3.query_smallint_ord"), + query_sql_domain: Some("eql_v4.query_smallint_ord"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -142,10 +142,10 @@ pub const TARGETS: &[Target] = &[ family: "smallint", suffix: "OrdOpe", plaintext: None, - sql_domain: "public.eql_v3_smallint_ord_ope", + sql_domain: "public.eql_v4_smallint_ord_ope", indexes: &["ope"], query: Some("SmallintOrdOpeQuery"), - query_sql_domain: Some("eql_v3.query_smallint_ord_ope"), + query_sql_domain: Some("eql_v4.query_smallint_ord_ope"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -156,7 +156,7 @@ pub const TARGETS: &[Target] = &[ family: "bigint", suffix: "", plaintext: None, - sql_domain: "public.eql_v3_bigint", + sql_domain: "public.eql_v4_bigint", indexes: &[], query: None, query_sql_domain: None, @@ -170,10 +170,10 @@ pub const TARGETS: &[Target] = &[ family: "bigint", suffix: "Eq", plaintext: None, - sql_domain: "public.eql_v3_bigint_eq", + sql_domain: "public.eql_v4_bigint_eq", indexes: &["eq"], query: Some("BigintEqQuery"), - query_sql_domain: Some("eql_v3.query_bigint_eq"), + query_sql_domain: Some("eql_v4.query_bigint_eq"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -184,10 +184,10 @@ pub const TARGETS: &[Target] = &[ family: "bigint", suffix: "OrdOre", plaintext: None, - sql_domain: "public.eql_v3_bigint_ord_ore", + sql_domain: "public.eql_v4_bigint_ord_ore", indexes: &["ore"], query: Some("BigintOrdOreQuery"), - query_sql_domain: Some("eql_v3.query_bigint_ord_ore"), + query_sql_domain: Some("eql_v4.query_bigint_ord_ore"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -198,10 +198,10 @@ pub const TARGETS: &[Target] = &[ family: "bigint", suffix: "Ord", plaintext: None, - sql_domain: "public.eql_v3_bigint_ord", + sql_domain: "public.eql_v4_bigint_ord", indexes: &["ope"], query: Some("BigintOrdQuery"), - query_sql_domain: Some("eql_v3.query_bigint_ord"), + query_sql_domain: Some("eql_v4.query_bigint_ord"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -212,10 +212,10 @@ pub const TARGETS: &[Target] = &[ family: "bigint", suffix: "OrdOpe", plaintext: None, - sql_domain: "public.eql_v3_bigint_ord_ope", + sql_domain: "public.eql_v4_bigint_ord_ope", indexes: &["ope"], query: Some("BigintOrdOpeQuery"), - query_sql_domain: Some("eql_v3.query_bigint_ord_ope"), + query_sql_domain: Some("eql_v4.query_bigint_ord_ope"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -226,7 +226,7 @@ pub const TARGETS: &[Target] = &[ family: "date", suffix: "", plaintext: None, - sql_domain: "public.eql_v3_date", + sql_domain: "public.eql_v4_date", indexes: &[], query: None, query_sql_domain: None, @@ -240,10 +240,10 @@ pub const TARGETS: &[Target] = &[ family: "date", suffix: "Eq", plaintext: None, - sql_domain: "public.eql_v3_date_eq", + sql_domain: "public.eql_v4_date_eq", indexes: &["eq"], query: Some("DateEqQuery"), - query_sql_domain: Some("eql_v3.query_date_eq"), + query_sql_domain: Some("eql_v4.query_date_eq"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -254,10 +254,10 @@ pub const TARGETS: &[Target] = &[ family: "date", suffix: "OrdOre", plaintext: None, - sql_domain: "public.eql_v3_date_ord_ore", + sql_domain: "public.eql_v4_date_ord_ore", indexes: &["ore"], query: Some("DateOrdOreQuery"), - query_sql_domain: Some("eql_v3.query_date_ord_ore"), + query_sql_domain: Some("eql_v4.query_date_ord_ore"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -268,10 +268,10 @@ pub const TARGETS: &[Target] = &[ family: "date", suffix: "Ord", plaintext: None, - sql_domain: "public.eql_v3_date_ord", + sql_domain: "public.eql_v4_date_ord", indexes: &["ope"], query: Some("DateOrdQuery"), - query_sql_domain: Some("eql_v3.query_date_ord"), + query_sql_domain: Some("eql_v4.query_date_ord"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -282,10 +282,10 @@ pub const TARGETS: &[Target] = &[ family: "date", suffix: "OrdOpe", plaintext: None, - sql_domain: "public.eql_v3_date_ord_ope", + sql_domain: "public.eql_v4_date_ord_ope", indexes: &["ope"], query: Some("DateOrdOpeQuery"), - query_sql_domain: Some("eql_v3.query_date_ord_ope"), + query_sql_domain: Some("eql_v4.query_date_ord_ope"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -296,7 +296,7 @@ pub const TARGETS: &[Target] = &[ family: "timestamp", suffix: "", plaintext: None, - sql_domain: "public.eql_v3_timestamp", + sql_domain: "public.eql_v4_timestamp", indexes: &[], query: None, query_sql_domain: None, @@ -310,10 +310,10 @@ pub const TARGETS: &[Target] = &[ family: "timestamp", suffix: "Eq", plaintext: None, - sql_domain: "public.eql_v3_timestamp_eq", + sql_domain: "public.eql_v4_timestamp_eq", indexes: &["eq"], query: Some("TimestampEqQuery"), - query_sql_domain: Some("eql_v3.query_timestamp_eq"), + query_sql_domain: Some("eql_v4.query_timestamp_eq"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -324,10 +324,10 @@ pub const TARGETS: &[Target] = &[ family: "timestamp", suffix: "OrdOre", plaintext: None, - sql_domain: "public.eql_v3_timestamp_ord_ore", + sql_domain: "public.eql_v4_timestamp_ord_ore", indexes: &["ore"], query: Some("TimestampOrdOreQuery"), - query_sql_domain: Some("eql_v3.query_timestamp_ord_ore"), + query_sql_domain: Some("eql_v4.query_timestamp_ord_ore"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -338,10 +338,10 @@ pub const TARGETS: &[Target] = &[ family: "timestamp", suffix: "Ord", plaintext: None, - sql_domain: "public.eql_v3_timestamp_ord", + sql_domain: "public.eql_v4_timestamp_ord", indexes: &["ope"], query: Some("TimestampOrdQuery"), - query_sql_domain: Some("eql_v3.query_timestamp_ord"), + query_sql_domain: Some("eql_v4.query_timestamp_ord"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -352,10 +352,10 @@ pub const TARGETS: &[Target] = &[ family: "timestamp", suffix: "OrdOpe", plaintext: None, - sql_domain: "public.eql_v3_timestamp_ord_ope", + sql_domain: "public.eql_v4_timestamp_ord_ope", indexes: &["ope"], query: Some("TimestampOrdOpeQuery"), - query_sql_domain: Some("eql_v3.query_timestamp_ord_ope"), + query_sql_domain: Some("eql_v4.query_timestamp_ord_ope"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -366,7 +366,7 @@ pub const TARGETS: &[Target] = &[ family: "numeric", suffix: "", plaintext: None, - sql_domain: "public.eql_v3_numeric", + sql_domain: "public.eql_v4_numeric", indexes: &[], query: None, query_sql_domain: None, @@ -380,10 +380,10 @@ pub const TARGETS: &[Target] = &[ family: "numeric", suffix: "Eq", plaintext: None, - sql_domain: "public.eql_v3_numeric_eq", + sql_domain: "public.eql_v4_numeric_eq", indexes: &["eq"], query: Some("NumericEqQuery"), - query_sql_domain: Some("eql_v3.query_numeric_eq"), + query_sql_domain: Some("eql_v4.query_numeric_eq"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -394,10 +394,10 @@ pub const TARGETS: &[Target] = &[ family: "numeric", suffix: "OrdOre", plaintext: None, - sql_domain: "public.eql_v3_numeric_ord_ore", + sql_domain: "public.eql_v4_numeric_ord_ore", indexes: &["ore"], query: Some("NumericOrdOreQuery"), - query_sql_domain: Some("eql_v3.query_numeric_ord_ore"), + query_sql_domain: Some("eql_v4.query_numeric_ord_ore"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -408,10 +408,10 @@ pub const TARGETS: &[Target] = &[ family: "numeric", suffix: "Ord", plaintext: None, - sql_domain: "public.eql_v3_numeric_ord", + sql_domain: "public.eql_v4_numeric_ord", indexes: &["ope"], query: Some("NumericOrdQuery"), - query_sql_domain: Some("eql_v3.query_numeric_ord"), + query_sql_domain: Some("eql_v4.query_numeric_ord"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -422,10 +422,10 @@ pub const TARGETS: &[Target] = &[ family: "numeric", suffix: "OrdOpe", plaintext: None, - sql_domain: "public.eql_v3_numeric_ord_ope", + sql_domain: "public.eql_v4_numeric_ord_ope", indexes: &["ope"], query: Some("NumericOrdOpeQuery"), - query_sql_domain: Some("eql_v3.query_numeric_ord_ope"), + query_sql_domain: Some("eql_v4.query_numeric_ord_ope"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -436,7 +436,7 @@ pub const TARGETS: &[Target] = &[ family: "text", suffix: "", plaintext: Some("string"), - sql_domain: "public.eql_v3_text", + sql_domain: "public.eql_v4_text", indexes: &[], query: None, query_sql_domain: None, @@ -450,10 +450,10 @@ pub const TARGETS: &[Target] = &[ family: "text", suffix: "Eq", plaintext: Some("string"), - sql_domain: "public.eql_v3_text_eq", + sql_domain: "public.eql_v4_text_eq", indexes: &["eq"], query: Some("TextEqQuery"), - query_sql_domain: Some("eql_v3.query_text_eq"), + query_sql_domain: Some("eql_v4.query_text_eq"), producible: true, reason: None, }, @@ -462,10 +462,10 @@ pub const TARGETS: &[Target] = &[ family: "text", suffix: "Match", plaintext: Some("string"), - sql_domain: "public.eql_v3_text_match", + sql_domain: "public.eql_v4_text_match", indexes: &["match"], query: Some("TextMatchQuery"), - query_sql_domain: Some("eql_v3.query_text_match"), + query_sql_domain: Some("eql_v4.query_text_match"), producible: false, reason: Some( "the engine derives match and OPE terms, but no EQL type is built from them yet", @@ -476,10 +476,10 @@ pub const TARGETS: &[Target] = &[ family: "text", suffix: "OrdOre", plaintext: Some("string"), - sql_domain: "public.eql_v3_text_ord_ore", + sql_domain: "public.eql_v4_text_ord_ore", indexes: &["eq", "ore"], query: Some("TextOrdOreQuery"), - query_sql_domain: Some("eql_v3.query_text_ord_ore"), + query_sql_domain: Some("eql_v4.query_text_ord_ore"), producible: false, reason: Some( "EQL stores a block ORE term and the engine derives a CLLW ORE term; the two are different algorithms", @@ -490,10 +490,10 @@ pub const TARGETS: &[Target] = &[ family: "text", suffix: "Ord", plaintext: Some("string"), - sql_domain: "public.eql_v3_text_ord", + sql_domain: "public.eql_v4_text_ord", indexes: &["eq", "ope"], query: Some("TextOrdQuery"), - query_sql_domain: Some("eql_v3.query_text_ord"), + query_sql_domain: Some("eql_v4.query_text_ord"), producible: false, reason: Some( "the engine derives match and OPE terms, but no EQL type is built from them yet", @@ -504,10 +504,10 @@ pub const TARGETS: &[Target] = &[ family: "text", suffix: "OrdOpe", plaintext: Some("string"), - sql_domain: "public.eql_v3_text_ord_ope", + sql_domain: "public.eql_v4_text_ord_ope", indexes: &["eq", "ope"], query: Some("TextOrdOpeQuery"), - query_sql_domain: Some("eql_v3.query_text_ord_ope"), + query_sql_domain: Some("eql_v4.query_text_ord_ope"), producible: false, reason: Some( "the engine derives match and OPE terms, but no EQL type is built from them yet", @@ -518,10 +518,10 @@ pub const TARGETS: &[Target] = &[ family: "text", suffix: "SearchOre", plaintext: Some("string"), - sql_domain: "public.eql_v3_text_search_ore", + sql_domain: "public.eql_v4_text_search_ore", indexes: &["eq", "ore", "match"], query: Some("TextSearchOreQuery"), - query_sql_domain: Some("eql_v3.query_text_search_ore"), + query_sql_domain: Some("eql_v4.query_text_search_ore"), producible: false, reason: Some( "EQL stores a block ORE term and the engine derives a CLLW ORE term; the two are different algorithms", @@ -532,10 +532,10 @@ pub const TARGETS: &[Target] = &[ family: "text", suffix: "Search", plaintext: Some("string"), - sql_domain: "public.eql_v3_text_search", + sql_domain: "public.eql_v4_text_search", indexes: &["eq", "ope", "match"], query: Some("TextSearchQuery"), - query_sql_domain: Some("eql_v3.query_text_search"), + query_sql_domain: Some("eql_v4.query_text_search"), producible: false, reason: Some( "the engine derives match and OPE terms, but no EQL type is built from them yet", @@ -546,7 +546,7 @@ pub const TARGETS: &[Target] = &[ family: "boolean", suffix: "", plaintext: None, - sql_domain: "public.eql_v3_boolean", + sql_domain: "public.eql_v4_boolean", indexes: &[], query: None, query_sql_domain: None, @@ -560,7 +560,7 @@ pub const TARGETS: &[Target] = &[ family: "real", suffix: "", plaintext: None, - sql_domain: "public.eql_v3_real", + sql_domain: "public.eql_v4_real", indexes: &[], query: None, query_sql_domain: None, @@ -574,10 +574,10 @@ pub const TARGETS: &[Target] = &[ family: "real", suffix: "Eq", plaintext: None, - sql_domain: "public.eql_v3_real_eq", + sql_domain: "public.eql_v4_real_eq", indexes: &["eq"], query: Some("RealEqQuery"), - query_sql_domain: Some("eql_v3.query_real_eq"), + query_sql_domain: Some("eql_v4.query_real_eq"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -588,10 +588,10 @@ pub const TARGETS: &[Target] = &[ family: "real", suffix: "OrdOre", plaintext: None, - sql_domain: "public.eql_v3_real_ord_ore", + sql_domain: "public.eql_v4_real_ord_ore", indexes: &["ore"], query: Some("RealOrdOreQuery"), - query_sql_domain: Some("eql_v3.query_real_ord_ore"), + query_sql_domain: Some("eql_v4.query_real_ord_ore"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -602,10 +602,10 @@ pub const TARGETS: &[Target] = &[ family: "real", suffix: "Ord", plaintext: None, - sql_domain: "public.eql_v3_real_ord", + sql_domain: "public.eql_v4_real_ord", indexes: &["ope"], query: Some("RealOrdQuery"), - query_sql_domain: Some("eql_v3.query_real_ord"), + query_sql_domain: Some("eql_v4.query_real_ord"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -616,10 +616,10 @@ pub const TARGETS: &[Target] = &[ family: "real", suffix: "OrdOpe", plaintext: None, - sql_domain: "public.eql_v3_real_ord_ope", + sql_domain: "public.eql_v4_real_ord_ope", indexes: &["ope"], query: Some("RealOrdOpeQuery"), - query_sql_domain: Some("eql_v3.query_real_ord_ope"), + query_sql_domain: Some("eql_v4.query_real_ord_ope"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -630,7 +630,7 @@ pub const TARGETS: &[Target] = &[ family: "double", suffix: "", plaintext: None, - sql_domain: "public.eql_v3_double", + sql_domain: "public.eql_v4_double", indexes: &[], query: None, query_sql_domain: None, @@ -644,10 +644,10 @@ pub const TARGETS: &[Target] = &[ family: "double", suffix: "Eq", plaintext: None, - sql_domain: "public.eql_v3_double_eq", + sql_domain: "public.eql_v4_double_eq", indexes: &["eq"], query: Some("DoubleEqQuery"), - query_sql_domain: Some("eql_v3.query_double_eq"), + query_sql_domain: Some("eql_v4.query_double_eq"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -658,10 +658,10 @@ pub const TARGETS: &[Target] = &[ family: "double", suffix: "OrdOre", plaintext: None, - sql_domain: "public.eql_v3_double_ord_ore", + sql_domain: "public.eql_v4_double_ord_ore", indexes: &["ore"], query: Some("DoubleOrdOreQuery"), - query_sql_domain: Some("eql_v3.query_double_ord_ore"), + query_sql_domain: Some("eql_v4.query_double_ord_ore"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -672,10 +672,10 @@ pub const TARGETS: &[Target] = &[ family: "double", suffix: "Ord", plaintext: None, - sql_domain: "public.eql_v3_double_ord", + sql_domain: "public.eql_v4_double_ord", indexes: &["ope"], query: Some("DoubleOrdQuery"), - query_sql_domain: Some("eql_v3.query_double_ord"), + query_sql_domain: Some("eql_v4.query_double_ord"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -686,10 +686,10 @@ pub const TARGETS: &[Target] = &[ family: "double", suffix: "OrdOpe", plaintext: None, - sql_domain: "public.eql_v3_double_ord_ope", + sql_domain: "public.eql_v4_double_ord_ope", indexes: &["ope"], query: Some("DoubleOrdOpeQuery"), - query_sql_domain: Some("eql_v3.query_double_ord_ope"), + query_sql_domain: Some("eql_v4.query_double_ord_ope"), producible: false, reason: Some( "how this family encodes a plaintext for the stack-encrypt producer profile is not specified; only the text family's encoding is", @@ -700,10 +700,10 @@ pub const TARGETS: &[Target] = &[ family: "json", suffix: "Search", plaintext: None, - sql_domain: "public.eql_v3_json_search", + sql_domain: "public.eql_v4_json_search", indexes: &["json"], query: Some("SteVecQuery"), - query_sql_domain: Some("eql_v3.query_json"), + query_sql_domain: Some("eql_v4.query_json"), producible: false, reason: Some("the JSON index is a new operation in the engine"), }, @@ -712,7 +712,7 @@ pub const TARGETS: &[Target] = &[ family: "json", suffix: "", plaintext: None, - sql_domain: "public.eql_v3_json", + sql_domain: "public.eql_v4_json", indexes: &[], query: None, query_sql_domain: None, diff --git a/packages/eql/crates/eql-bindings/src/v4/text.rs b/packages/eql/crates/eql-bindings/src/v4/text.rs new file mode 100644 index 000000000..ce20abc8a --- /dev/null +++ b/packages/eql/crates/eql-bindings/src/v4/text.rs @@ -0,0 +1,679 @@ +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `text` encrypted-domain family — generated from the eql-domains catalog. +use crate::v4::terms::{BloomFilter, Ciphertext, Hmac256, OpeCllw, OreBlock256}; +use crate::v4::{DomainType, SchemaVersion}; +use crate::Identifier; +use schemars::{schema_for, JsonSchema, Schema}; +use serde::{Deserialize, Serialize}; +use ts_rs::TS; +/// `public.eql_v4_text` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct Text { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, +} +impl DomainType for Text { + fn sql_domain_static() -> &'static str { + "public.eql_v4_text" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&[]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + Text::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(Text) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_text_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." +)] +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " Plaintext input and decrypted output: [`String`]. With the `stack-encrypt` feature, implements `EncryptFrom` and `DecryptInto`." +)] +#[cfg_attr( + all(doc, feature = "stack-encrypt"), + doc = " Encryption context: `NonEmpty`, constructed with `Identifier::for_column(table, column)` and stored in `i`." +)] +#[cfg_attr( + all(doc, feature = "stack-encrypt"), + doc = " See the [complete encryption example](crate::encryption#example)." +)] +#[cfg_attr(feature = "stack-encrypt", derive(stack_encrypt::EncryptFrom))] +#[cfg_attr(feature = "stack-encrypt", derive(stack_encrypt::DecryptInto))] +#[cfg_attr(feature = "stack-encrypt", stash(plaintext = String))] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TextEq { + #[cfg_attr(feature = "stack-encrypt", stash(default))] + pub v: SchemaVersion, + #[cfg_attr(feature = "stack-encrypt", stash(context_field))] + pub i: Identifier, + pub c: Ciphertext, + pub hm: Hmac256, +} +impl DomainType for TextEq { + fn sql_domain_static() -> &'static str { + "public.eql_v4_text_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TextEq::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TextEq) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_text_match` — match domain. +/// +/// Operators: `@@`. Required keys: `v` `i` `c` `bf`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TextMatch { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub bf: BloomFilter, +} +impl DomainType for TextMatch { + fn sql_domain_static() -> &'static str { + "public.eql_v4_text_match" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["bf"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TextMatch::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TextMatch) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_text_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `hm` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TextOrdOre { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub hm: Hmac256, + pub ob: OreBlock256, +} +impl DomainType for TextOrdOre { + fn sql_domain_static() -> &'static str { + "public.eql_v4_text_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm", "ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TextOrdOre::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TextOrdOre) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_text_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `hm` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TextOrd { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub hm: Hmac256, + pub op: OpeCllw, +} +impl DomainType for TextOrd { + fn sql_domain_static() -> &'static str { + "public.eql_v4_text_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm", "op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TextOrd::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TextOrd) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_text_ord_ope` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `hm` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TextOrdOpe { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub hm: Hmac256, + pub op: OpeCllw, +} +impl DomainType for TextOrdOpe { + fn sql_domain_static() -> &'static str { + "public.eql_v4_text_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm", "op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TextOrdOpe::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TextOrdOpe) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_text_search_ore` — search domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=` `@@`. Required keys: `v` `i` `c` `hm` `ob` `bf`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TextSearchOre { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub hm: Hmac256, + pub ob: OreBlock256, + pub bf: BloomFilter, +} +impl DomainType for TextSearchOre { + fn sql_domain_static() -> &'static str { + "public.eql_v4_text_search_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm", "ob", "bf"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TextSearchOre::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TextSearchOre) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_text_search` — search domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=` `@@`. Required keys: `v` `i` `c` `hm` `op` `bf`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TextSearch { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub hm: Hmac256, + pub op: OpeCllw, + pub bf: BloomFilter, +} +impl DomainType for TextSearch { + fn sql_domain_static() -> &'static str { + "public.eql_v4_text_search" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm", "op", "bf"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TextSearch::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TextSearch) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_text_eq` — equality domain query operand. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." +)] +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " Plaintext input: [`String`]. With the `stack-encrypt` feature, implements `EncryptFrom` to build equality query terms. Query operands do not decrypt." +)] +#[cfg_attr( + all(doc, feature = "stack-encrypt"), + doc = " Encryption context: `NonEmpty`, constructed with `Identifier::for_column(table, column)` and stored in `i`." +)] +#[cfg_attr( + all(doc, feature = "stack-encrypt"), + doc = " See the [complete encryption example](crate::encryption#example)." +)] +#[cfg_attr(feature = "stack-encrypt", derive(stack_encrypt::EncryptFrom))] +#[cfg_attr(feature = "stack-encrypt", stash(plaintext = String))] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TextEqQuery { + #[cfg_attr(feature = "stack-encrypt", stash(default))] + pub v: SchemaVersion, + #[cfg_attr(feature = "stack-encrypt", stash(context_field))] + pub i: Identifier, + pub hm: Hmac256, +} +impl DomainType for TextEqQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_text_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TextEqQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TextEqQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_text_match` — match domain query operand. +/// +/// Operators: `@@`. Required keys: `v` `i` `bf`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TextMatchQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub bf: BloomFilter, +} +impl DomainType for TextMatchQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_text_match" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["bf"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TextMatchQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TextMatchQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_text_ord_ore` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `hm` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TextOrdOreQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub hm: Hmac256, + pub ob: OreBlock256, +} +impl DomainType for TextOrdOreQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_text_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm", "ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TextOrdOreQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TextOrdOreQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_text_ord` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `hm` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TextOrdQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub hm: Hmac256, + pub op: OpeCllw, +} +impl DomainType for TextOrdQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_text_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm", "op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TextOrdQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TextOrdQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_text_ord_ope` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `hm` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TextOrdOpeQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub hm: Hmac256, + pub op: OpeCllw, +} +impl DomainType for TextOrdOpeQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_text_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm", "op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TextOrdOpeQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TextOrdOpeQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_text_search_ore` — search domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=` `@@`. Required keys: `v` `i` `hm` `ob` `bf`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TextSearchOreQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub hm: Hmac256, + pub ob: OreBlock256, + pub bf: BloomFilter, +} +impl DomainType for TextSearchOreQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_text_search_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm", "ob", "bf"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TextSearchOreQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TextSearchOreQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_text_search` — search domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=` `@@`. Required keys: `v` `i` `hm` `op` `bf`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL text reference](https://cipherstash.com/docs/reference/eql/text) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TextSearchQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub hm: Hmac256, + pub op: OpeCllw, + pub bf: BloomFilter, +} +impl DomainType for TextSearchQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_text_search" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm", "op", "bf"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TextSearchQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TextSearchQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} diff --git a/packages/eql/crates/eql-bindings/src/v4/timestamp.rs b/packages/eql/crates/eql-bindings/src/v4/timestamp.rs new file mode 100644 index 000000000..ef9545462 --- /dev/null +++ b/packages/eql/crates/eql-bindings/src/v4/timestamp.rs @@ -0,0 +1,381 @@ +// @generated by eql-codegen from the eql-domains catalog — do not edit +//! The `timestamp` encrypted-domain family — generated from the eql-domains catalog. +use crate::v4::terms::{Ciphertext, Hmac256, OpeCllw, OreBlock256}; +use crate::v4::{DomainType, SchemaVersion}; +use crate::Identifier; +use schemars::{schema_for, JsonSchema, Schema}; +use serde::{Deserialize, Serialize}; +use ts_rs::TS; +/// `public.eql_v4_timestamp` — storage-only domain. +/// +/// Operators: none. Required keys: `v` `i` `c`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL timestamp reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct Timestamp { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, +} +impl DomainType for Timestamp { + fn sql_domain_static() -> &'static str { + "public.eql_v4_timestamp" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&[]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + Timestamp::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(Timestamp) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_timestamp_eq` — equality domain. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `c` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL timestamp reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TimestampEq { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub hm: Hmac256, +} +impl DomainType for TimestampEq { + fn sql_domain_static() -> &'static str { + "public.eql_v4_timestamp_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TimestampEq::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TimestampEq) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_timestamp_ord_ore` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL timestamp reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TimestampOrdOre { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub ob: OreBlock256, +} +impl DomainType for TimestampOrdOre { + fn sql_domain_static() -> &'static str { + "public.eql_v4_timestamp_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TimestampOrdOre::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TimestampOrdOre) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_timestamp_ord` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL timestamp reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TimestampOrd { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub op: OpeCllw, +} +impl DomainType for TimestampOrd { + fn sql_domain_static() -> &'static str { + "public.eql_v4_timestamp_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TimestampOrd::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TimestampOrd) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `public.eql_v4_timestamp_ord_ope` — ordering domain. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `c` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL timestamp reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TimestampOrdOpe { + pub v: SchemaVersion, + pub i: Identifier, + pub c: Ciphertext, + pub op: OpeCllw, +} +impl DomainType for TimestampOrdOpe { + fn sql_domain_static() -> &'static str { + "public.eql_v4_timestamp_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TimestampOrdOpe::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TimestampOrdOpe) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_timestamp_eq` — equality domain query operand. +/// +/// Operators: `=` `<>`. Required keys: `v` `i` `hm`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL timestamp reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TimestampEqQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub hm: Hmac256, +} +impl DomainType for TimestampEqQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_timestamp_eq" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["hm"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TimestampEqQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TimestampEqQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_timestamp_ord_ore` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `ob`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL timestamp reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TimestampOrdOreQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub ob: OreBlock256, +} +impl DomainType for TimestampOrdOreQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_timestamp_ord_ore" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["ob"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TimestampOrdOreQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TimestampOrdOreQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_timestamp_ord` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL timestamp reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TimestampOrdQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub op: OpeCllw, +} +impl DomainType for TimestampOrdQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_timestamp_ord" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TimestampOrdQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TimestampOrdQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} +/// `eql_v4.query_timestamp_ord_ope` — ordering domain query operand. +/// +/// Operators: `=` `<>` `<` `<=` `>` `>=`. Required keys: `v` `i` `op`. +#[cfg_attr(doc, doc = "")] +#[cfg_attr( + doc, + doc = " See the [EQL timestamp reference](https://cipherstash.com/docs/reference/eql/dates-and-times) for SQL domain variants, operators, and query examples." +)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] +#[serde(deny_unknown_fields)] +pub struct TimestampOrdOpeQuery { + pub v: SchemaVersion, + pub i: Identifier, + pub op: OpeCllw, +} +impl DomainType for TimestampOrdOpeQuery { + fn sql_domain_static() -> &'static str { + "eql_v4.query_timestamp_ord_ope" + } + fn sql_domain(&self) -> &'static str { + Self::sql_domain_static() + } + fn term_json_keys_static() -> Option<&'static [&'static str]> { + Some(&["op"]) + } + fn term_json_keys(&self) -> Option<&'static [&'static str]> { + Self::term_json_keys_static() + } + fn parse_value(&self, value: &serde_json::Value) -> Result<(), serde_json::Error> { + TimestampOrdOpeQuery::deserialize(value).map(|_| ()) + } + fn schema(&self) -> Schema { + schema_for!(TimestampOrdOpeQuery) + } + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } +} diff --git a/packages/eql/crates/eql-bindings/tests/v4_parity.rs b/packages/eql/crates/eql-bindings/tests/v4_parity.rs new file mode 100644 index 000000000..41bdf2ae2 --- /dev/null +++ b/packages/eql/crates/eql-bindings/tests/v4_parity.rs @@ -0,0 +1,126 @@ +//! The v4 counterpart of `catalog_parity.rs`: every v4 inventory entry must be +//! the catalog domain it claims, under the `eql_v4` names, and the version +//! boundary between the two generations must hold in both directions. A v3 +//! payload that a v4 type accepted would let a cipherstash-client value be +//! read as a Stack Encrypt one (ADR-0002), so these are pinned with literals +//! rather than through the helpers they check. + +use eql_bindings::{v3, v4}; +use eql_domains::{Term, CATALOG}; +use serde_json::{json, Value}; + +/// The catalog's scalar domains under their v4 names, in catalog order. v4 has +/// no SteVec bindings, so only scalar domains appear. +fn expected_v4_domains() -> Vec { + CATALOG + .iter() + .flat_map(|spec| { + spec.domains + .iter() + .filter(|d| d.is_scalar()) + .map(move |d| spec.domain_name(d)) + }) + .map(|name| { + let bare = name + .strip_prefix(eql_domains::PUBLIC_TYPNAME_PREFIX) + .unwrap_or_else(|| panic!("{name} does not carry the v3 typname prefix")); + format!("{}{bare}", v4::PUBLIC_TYPNAME_PREFIX) + }) + .collect() +} + +#[test] +fn inventory_covers_the_scalar_catalog_in_order() { + let actual: Vec = v4::all().iter().map(|e| e.domain().to_string()).collect(); + assert_eq!( + actual, + expected_v4_domains(), + "v4::all() must list the catalog's scalar domains, as eql_v4_*, in catalog \ + order — regenerate with `mise run types:generate`" + ); +} + +#[test] +fn stored_entries_name_public_v4_domains_and_v4_schema_ids() { + for entry in v4::all() { + let name = entry.domain(); + assert_eq!(entry.sql_domain(), format!("public.{name}")); + assert!(name.starts_with("eql_v4_"), "{name}"); + assert_eq!( + entry.schema_id(), + format!("https://schemas.cipherstash.com/eql/v4/{name}.json") + ); + } +} + +#[test] +fn query_entries_live_in_the_eql_v4_schema() { + let v3_queries: Vec = v3::all_query() + .iter() + .filter(|e| e.term_json_keys().is_some()) + .map(|e| e.domain().to_string()) + .collect(); + let v4_queries: Vec = v4::all_query() + .iter() + .map(|e| { + let sql = e.sql_domain(); + assert!(sql.starts_with("eql_v4.query_"), "{sql}"); + e.domain().to_string() + }) + .collect(); + assert_eq!( + v4_queries, v3_queries, + "each scalar query twin exists in v4 under the same name" + ); +} + +#[test] +fn term_keys_match_the_catalog() { + let entries = v4::all(); + for spec in CATALOG { + for domain in spec.domains.iter().filter(|d| d.is_scalar()) { + let v3_name = spec.domain_name(domain); + let name = v3_name.replacen("eql_v3_", "eql_v4_", 1); + let entry = entries + .iter() + .find(|e| e.domain() == name) + .unwrap_or_else(|| panic!("no v4 inventory entry for {name}")); + assert_eq!( + entry.term_json_keys().map(<[&str]>::to_vec), + Some(Term::term_json_keys(domain.terms)), + "{name}" + ); + } + } +} + +fn text_eq(version: u8) -> Value { + json!({ + "v": version, + "i": { "t": "users", "c": "email" }, + "c": "stack-encrypt:1:ciphertext", + "hm": "a".repeat(64), + }) +} + +/// The boundary the move to v4 relies on: the payloads are otherwise +/// well-formed, so only the version can be what refuses them. +#[test] +fn each_generation_refuses_the_other_version() { + assert!(serde_json::from_value::(text_eq(4)).is_ok()); + assert!(serde_json::from_value::(text_eq(3)).is_ok()); + + let err = serde_json::from_value::(text_eq(3)).unwrap_err(); + assert!(err.to_string().contains("version 3"), "{err}"); + let err = serde_json::from_value::(text_eq(4)).unwrap_err(); + assert!(err.to_string().contains("version 4"), "{err}"); + + // And through the inventory, which is how a caller holding only a name + // validates a payload. + let v4_entry = v4::all() + .into_iter() + .find(|e| e.domain() == "eql_v4_text_eq") + .expect("eql_v4_text_eq in v4::all()"); + assert!(v4_entry.parse_value(&text_eq(4)).is_ok()); + assert!(v4_entry.parse_value(&text_eq(3)).is_err()); +} diff --git a/packages/eql/crates/eql-codegen/src/bindings.rs b/packages/eql/crates/eql-codegen/src/bindings.rs index ce50f07a1..bb96b4fc4 100644 --- a/packages/eql/crates/eql-codegen/src/bindings.rs +++ b/packages/eql/crates/eql-codegen/src/bindings.rs @@ -14,6 +14,7 @@ use quote::{format_ident, quote}; use eql_domains::{Domain, DomainFamily, Term, CATALOG, ENVELOPE_KEYS}; use crate::consts::RUST_GENERATED_MARKER; +use crate::render::EqlVersion; use crate::writer::{ ensure_generated_paths_writable, normalized_set, remove_generated_orphans, write_generated_file, GeneratedKind, WriteError, @@ -83,11 +84,21 @@ fn capability_label(domain_name: &str) -> &'static str { } } -/// The schema-qualified `eql_v3` domain a payload struct binds, e.g. -/// `public.eql_v3_integer_eq`. The bindings describe v3 payloads only, so they -/// name it literally, where the SQL surface writes the `{{prefix}}` placeholder. +/// The schema-qualified domain a payload struct binds, e.g. +/// `public.eql_v4_integer_eq`. The bindings name it literally, per version, +/// where the SQL surface writes the `{{prefix}}` placeholder. +fn domain_name(version: EqlVersion, full: &str) -> String { + format!("public.{}_{full}", version.prefix()) +} + +/// [`domain_name`] for the v3 payload enums, which describe v3 only. fn v3_domain_name(full: &str) -> String { - format!("public.{}{full}", eql_domains::PUBLIC_TYPNAME_PREFIX) + domain_name(EqlVersion::V3, full) +} + +/// The module a version's bindings live in: `v3`, `v4`. +fn module_name(version: EqlVersion) -> String { + format!("v{}", version.number()) } /// Render the catalog-derived struct doc lines for a domain: a summary line @@ -98,14 +109,14 @@ fn v3_domain_name(full: &str) -> String { /// `Term::term_json_keys`) — so it stays deterministic and cannot drift from the /// payload shape. No free-form prose and no field docs: per-field semantics live /// on the shared term newtypes (`terms.rs`) and per-family caveats in `mod.rs`. -fn struct_doc_lines(full: &str, domain: &Domain) -> [String; 3] { +fn struct_doc_lines(version: EqlVersion, full: &str, domain: &Domain) -> [String; 3] { // Leading space matches the `///` doc-comment convention (`#[doc = " …"]`): // rustfmt renders it as `/// …` and ts-rs as ` * …`. Without it the emitted // JSDoc/`///` lose the space after the prefix (`*`text`). schemars strips the // single leading space, so JSON Schema `description` is unaffected. let summary = format!( " `{}` — {}.", - v3_domain_name(full), + domain_name(version, full), capability_label(domain.name) ); @@ -166,13 +177,15 @@ fn reference_docs(family: &DomainFamily) -> TokenStream { /// no field docs. Term fields come from `Term::payload_terms`, matching on the /// enum for the field key and its newtype. The `schema` method returns /// `schemars::Schema` (1.x). -fn render_struct(family: &DomainFamily, domain: &Domain) -> TokenStream { +fn render_struct(eql: EqlVersion, family: &DomainFamily, domain: &Domain) -> TokenStream { let full = domain.full_name(family.name); let ident = format_ident!("{}", domain.struct_ident(family.name)); - let sql_domain = v3_domain_name(&full); - let [doc_summary, doc_blank, doc_detail] = struct_doc_lines(&full, domain); + let sql_domain = domain_name(eql, &full); + let [doc_summary, doc_blank, doc_detail] = struct_doc_lines(eql, &full, domain); let reference = reference_docs(family); - let (encryption, version, context) = encryption_attrs(family, domain, false); + let (encryption, version, context) = encryption_attrs(eql, family, domain, false); + let ts_export = ts_export(eql); + let schema_id = schema_id_override(eql); // The envelope triple is hardcoded (not looped over `ENVELOPE_KEYS`) because // each key maps to a distinct Rust type: `v: SchemaVersion`, `i: Identifier`, @@ -203,7 +216,7 @@ fn render_struct(family: &DomainFamily, domain: &Domain) -> TokenStream { #reference #encryption #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] - #[ts(export, export_to = "v3/")] + #ts_export #[serde(deny_unknown_fields)] pub struct #ident { #fields @@ -228,6 +241,7 @@ fn render_struct(family: &DomainFamily, domain: &Domain) -> TokenStream { fn schema(&self) -> Schema { schema_for!(#ident) } + #schema_id } } } @@ -239,19 +253,21 @@ fn render_struct(family: &DomainFamily, domain: &Domain) -> TokenStream { /// (or any storage key) a parse error, mirroring the SQL `query_` domain /// CHECK. Emitted only for term-bearing domains: a storage-only /// domain has no operators, so no query operand. -fn render_query_struct(family: &DomainFamily, domain: &Domain) -> TokenStream { +fn render_query_struct(eql: EqlVersion, family: &DomainFamily, domain: &Domain) -> TokenStream { let query_name = domain.query_name(family.name); let ident = format_ident!("{}Query", domain.struct_ident(family.name)); // Query operands live in the public-API schema, NOT `public`: they are // never valid column types. - let sql_domain = format!("eql_v3.{query_name}"); + let sql_domain = format!("{}.{query_name}", eql.prefix()); let reference = reference_docs(family); - let (encryption, version, context) = encryption_attrs(family, domain, true); + let (encryption, version, context) = encryption_attrs(eql, family, domain, true); + let ts_export = ts_export(eql); + let schema_id = schema_id_override(eql); // Query doc: same capability label + operator union as storage, but the // required-key list drops `c` (query operands omit the ciphertext). let summary = format!( - " `eql_v3.{query_name}` — {} query operand.", + " `{sql_domain}` — {} query operand.", capability_label(domain.name) ); let ops = Term::operators_for_terms(domain.terms); @@ -287,7 +303,7 @@ fn render_query_struct(family: &DomainFamily, domain: &Domain) -> TokenStream { #reference #encryption #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, TS, JsonSchema)] - #[ts(export, export_to = "v3/")] + #ts_export #[serde(deny_unknown_fields)] pub struct #ident { #fields @@ -312,6 +328,7 @@ fn render_query_struct(family: &DomainFamily, domain: &Domain) -> TokenStream { fn schema(&self) -> Schema { schema_for!(#ident) } + #schema_id } } } @@ -322,10 +339,23 @@ fn render_query_struct(family: &DomainFamily, domain: &Domain) -> TokenStream { /// together so a new domain cannot arrive without either a derive or a reason. pub const ENCRYPTION_DOMAINS: &[(&str, &str)] = &[("text", "eq")]; +/// Why no `eql_v3` struct derives Stack Encrypt's traits. +pub const V3_ENCRYPTION_GAP: &str = + "Stack Encrypt produces EQL v4 only: its output is not byte-for-byte compatible with \ + cipherstash-client's, which writes the eql_v3 domains"; + /// Why a stored domain carries no `stack-encrypt` derive yet, or `None` when /// it does. Derived from the catalog's own facts (family, terms), not from a -/// per-domain list, so it answers for a domain added tomorrow. -pub fn encryption_gap(family: &DomainFamily, domain: &Domain) -> Option<&'static str> { +/// per-domain list, so it answers for a domain added tomorrow. No `eql_v3` +/// domain carries one ([`V3_ENCRYPTION_GAP`]). +pub fn encryption_gap( + version: EqlVersion, + family: &DomainFamily, + domain: &Domain, +) -> Option<&'static str> { + if version == EqlVersion::V3 { + return Some(V3_ENCRYPTION_GAP); + } if ENCRYPTION_DOMAINS.contains(&(family.name, domain.name)) { return None; } @@ -352,11 +382,12 @@ pub fn encryption_gap(family: &DomainFamily, domain: &Domain) -> Option<&'static /// derives without enabling other domains before their operations and /// plaintext contracts are supported ([`ENCRYPTION_DOMAINS`]). fn encryption_attrs( + version: EqlVersion, family: &DomainFamily, domain: &Domain, query: bool, ) -> (TokenStream, TokenStream, TokenStream) { - if encryption_gap(family, domain).is_some() { + if encryption_gap(version, family, domain).is_some() { return Default::default(); } let decrypt = (!query).then( @@ -384,10 +415,53 @@ fn encryption_attrs( ) } +/// A v4 struct's `DomainType::schema_id` overrides: the trait's defaults name +/// the v3 schema base. Both forms, since the inventory's `PhantomData` handles +/// reach the type-level one. +fn schema_id_override(version: EqlVersion) -> TokenStream { + match version { + EqlVersion::V3 => quote!(), + EqlVersion::V4 => quote! { + fn schema_id_base_static() -> &'static str { + super::SCHEMA_ID_BASE + } + fn schema_id(&self) -> String { + format!("{}{}.json", super::SCHEMA_ID_BASE, self.domain()) + } + }, + } +} + +/// The ts-rs export attribute. The v3 structs export to the committed +/// TypeScript bindings; the v4 structs derive `TS` but export nothing until +/// `@cipherstash/eql` 4.0 decides how it presents them. +fn ts_export(version: EqlVersion) -> TokenStream { + match version { + EqlVersion::V3 => quote!(#[ts(export, export_to = "v3/")]), + EqlVersion::V4 => quote!(), + } +} + +/// The `use` header every family module shares: the term newtypes the +/// family names, the trait, and the version's own `SchemaVersion`. +fn family_imports(version: EqlVersion, used: &[&'static str]) -> TokenStream { + let used_idents: Vec<_> = used.iter().map(|t| format_ident!("{t}")).collect(); + let module = format_ident!("{}", module_name(version)); + quote! { + use schemars::{schema_for, JsonSchema, Schema}; + + use crate::#module::terms::{ #(#used_idents),* }; + use crate::#module::{DomainType, SchemaVersion}; + use crate::Identifier; + use serde::{Deserialize, Serialize}; + use ts_rs::TS; + } +} + /// Render a whole family module (`integer.rs`, `text.rs`, …): the import header /// (exactly the term newtypes the family uses) followed by every domain's /// storage struct + impl, then a query twin for each term-bearing domain. -pub fn render_family_bindings(family: &DomainFamily) -> String { +pub fn render_family_bindings(version: EqlVersion, family: &DomainFamily) -> String { let mut used: Vec<&'static str> = vec!["Ciphertext"]; for d in family.domains { for term in Term::payload_terms(d.terms) { @@ -397,20 +471,20 @@ pub fn render_family_bindings(family: &DomainFamily) -> String { } } } - let used_idents: Vec<_> = used.iter().map(|t| format_ident!("{t}")).collect(); + let imports = family_imports(version, &used); // Storage structs for every domain, then a query twin for each term-bearing // domain (storage-only domains have no operators, so no query operand). let structs: TokenStream = family .domains .iter() - .map(|d| render_struct(family, d)) + .map(|d| render_struct(version, family, d)) .chain( family .domains .iter() .filter(|d| !d.terms.is_empty()) - .map(|d| render_query_struct(family, d)), + .map(|d| render_query_struct(version, family, d)), ) .collect(); @@ -422,13 +496,7 @@ pub fn render_family_bindings(family: &DomainFamily) -> String { let file = quote! { #![doc = #mod_doc] - use schemars::{schema_for, JsonSchema, Schema}; - - use crate::v3::terms::{ #(#used_idents),* }; - use crate::v3::DomainType; - use crate::{Identifier, SchemaVersion}; - use serde::{Deserialize, Serialize}; - use ts_rs::TS; + #imports #structs }; @@ -445,7 +513,7 @@ pub fn render_family_bindings(family: &DomainFamily) -> String { /// `.rs`, so it never clobbers the hand-written module — the hand-written /// `json.rs` re-exports the generated struct (`pub use ...::Json;`) so /// `super::json::Json` resolves for the inventory/payload renderers. -pub fn render_scalar_only_bindings(family: &DomainFamily) -> String { +pub fn render_scalar_only_bindings(version: EqlVersion, family: &DomainFamily) -> String { let mut used: Vec<&'static str> = vec!["Ciphertext"]; for d in family.domains.iter().filter(|d| d.is_scalar()) { for term in Term::payload_terms(d.terms) { @@ -455,7 +523,7 @@ pub fn render_scalar_only_bindings(family: &DomainFamily) -> String { } } } - let used_idents: Vec<_> = used.iter().map(|t| format_ident!("{t}")).collect(); + let imports = family_imports(version, &used); // Scalar storage structs only, then a query twin for each term-bearing scalar // domain (a bare storage domain has empty terms, so no query operand). @@ -463,33 +531,34 @@ pub fn render_scalar_only_bindings(family: &DomainFamily) -> String { .domains .iter() .filter(|d| d.is_scalar()) - .map(|d| render_struct(family, d)) + .map(|d| render_struct(version, family, d)) .chain( family .domains .iter() .filter(|d| d.is_scalar() && !d.terms.is_empty()) - .map(|d| render_query_struct(family, d)), + .map(|d| render_query_struct(version, family, d)), ) .collect(); - let mod_doc = format!( - " The generated scalar (storage) domain(s) of the `{}` encrypted-domain family — \ - generated from the eql-domains catalog. The family's SteVec domains are hand-written \ - in `{}.rs`.", - family.name, family.name - ); + let mod_doc = match version { + EqlVersion::V3 => format!( + " The generated scalar (storage) domain(s) of the `{}` encrypted-domain family — \ + generated from the eql-domains catalog. The family's SteVec domains are hand-written \ + in `{}.rs`.", + family.name, family.name + ), + EqlVersion::V4 => format!( + " The generated scalar (storage) domain(s) of the `{}` encrypted-domain family — \ + generated from the eql-domains catalog. EQL v4 has no SteVec bindings yet.", + family.name + ), + }; let file = quote! { #![doc = #mod_doc] - use schemars::{schema_for, JsonSchema, Schema}; - - use crate::v3::terms::{ #(#used_idents),* }; - use crate::v3::DomainType; - use crate::{Identifier, SchemaVersion}; - use serde::{Deserialize, Serialize}; - use ts_rs::TS; + #imports #structs }; @@ -497,6 +566,66 @@ pub fn render_scalar_only_bindings(family: &DomainFamily) -> String { format_rs(file) } +/// Render the generated `crates/eql-bindings/src/v4/inventory.rs`: every v4 +/// scalar stored type in `all()` and every query twin in `all_query()`, in +/// CATALOG order. v4 has no SteVec bindings, so unlike v3 its `all()` holds +/// scalar domains only. +pub fn render_v4_inventory_rs() -> String { + let scalar = || { + eql_domains::families_with_scalar_domains().flat_map(|f| { + f.domains + .iter() + .filter(|d| d.is_scalar()) + .map(move |d| (f, d)) + }) + }; + let all_entries: TokenStream = scalar() + .map(|(f, d)| { + let m = format_ident!("{}", f.name); + let s = format_ident!("{}", d.rust_struct_name(f.name)); + quote! { Box::new(PhantomData::), } + }) + .collect(); + let query_entries: TokenStream = scalar() + .filter(|(_, d)| !d.terms.is_empty()) + .map(|(f, d)| { + let m = format_ident!("{}", f.name); + let s = format_ident!("{}Query", d.struct_ident(f.name)); + quote! { Box::new(PhantomData::), } + }) + .collect(); + + let mod_doc = " The `all()` / `all_query()` inventories — every v4 stored and \ + query-operand payload type in eql-domains::CATALOG order. \ + Generated from the catalog."; + + let file = quote! { + #![doc = #mod_doc] + + use std::marker::PhantomData; + + use super::DomainType; + + /// Every v4 stored-payload domain type, in `eql-domains::CATALOG` + /// order — generated. Scalar domains only: v4 has no SteVec bindings. + pub fn all() -> Vec> { + vec![ + #all_entries + ] + } + + /// Every v4 QUERY-operand twin (`eql_v4.query_`), in + /// `eql-domains::CATALOG` order — generated. + pub fn all_query() -> Vec> { + vec![ + #query_entries + ] + } + }; + + format_rs(file) +} + /// Render the generated `crates/eql-bindings/src/v3/inventory.rs`: just `all()` /// in CATALOG order, referencing the family structs through `super::`. The /// `pub mod` declarations, the trait re-export, the trait/newtypes, and the @@ -831,8 +960,10 @@ pub fn render_query_payload_rs() -> String { format_rs(file) } -/// Relative path (from repo root) of the generated v3 bindings directory. -const V3_BINDINGS_DIR: &str = "crates/eql-bindings/src/v3"; +/// Relative path (from repo root) of a version's generated bindings directory. +fn bindings_dir(version: EqlVersion) -> String { + format!("crates/eql-bindings/src/{}", module_name(version)) +} /// Render every binding file to memory (NO filesystem writes): one /// `(/.rs, body)` per catalog family in CATALOG order, then @@ -846,7 +977,7 @@ fn render_bindings(dir: &Path) -> Vec<(PathBuf, String)> { .map(|f| { ( dir.join(format!("{}.rs", f.name)), - render_family_bindings(f), + render_family_bindings(EqlVersion::V3, f), ) }) .collect(); @@ -859,18 +990,37 @@ fn render_bindings(dir: &Path) -> Vec<(PathBuf, String)> { for f in eql_domains::families_with_scalar_domains().filter(|f| !f.is_scalar()) { rendered.push(( dir.join(format!("{}_storage.rs", f.name)), - render_scalar_only_bindings(f), + render_scalar_only_bindings(EqlVersion::V3, f), )); } rendered.push((dir.join("payload.rs"), render_payload_rs())); rendered.push((dir.join("query_payload.rs"), render_query_payload_rs())); - // The stack-encrypt target table and dispatch (`crate::targets`); gated - // to the `stack-encrypt` feature by the hand-written mod.rs. - rendered.push((dir.join("targets.rs"), crate::targets::render_targets_rs())); rendered.push((dir.join("inventory.rs"), render_inventory_rs())); rendered } +/// Render the v4 bindings: one module per family with a scalar domain (a +/// mixed family's scalar domains under its own name, since v4 has no +/// hand-written SteVec module to sit beside), and the Stack Encrypt target +/// table and dispatch (`targets.rs`, gated to the `stack-encrypt` feature by +/// the hand-written `v4/mod.rs`). Stack Encrypt produces v4 only, so the +/// target table lives here. +fn render_v4_bindings(dir: &Path) -> Vec<(PathBuf, String)> { + let mut rendered: Vec<(PathBuf, String)> = eql_domains::families_with_scalar_domains() + .map(|f| { + let body = if f.is_scalar() { + render_family_bindings(EqlVersion::V4, f) + } else { + render_scalar_only_bindings(EqlVersion::V4, f) + }; + (dir.join(format!("{}.rs", f.name)), body) + }) + .collect(); + rendered.push((dir.join("targets.rs"), crate::targets::render_targets_rs())); + rendered.push((dir.join("inventory.rs"), render_v4_inventory_rs())); + rendered +} + /// Regenerate every committed Rust binding file under `out_root`: one /// `.rs` per catalog family plus the `inventory.rs` `all()` list. /// Hand-written `terms.rs` / `domain_type.rs` / `mod.rs` carry no marker, so @@ -885,9 +1035,11 @@ fn render_bindings(dir: &Path) -> Vec<(PathBuf, String)> { /// prunes `.rs` for a type dropped from the catalog, marker-aware so the /// hand-written `terms.rs` / `domain_type.rs` / `mod.rs` are always preserved. pub fn generate_bindings(out_root: &Path) -> Result, WriteError> { - let dir = out_root.join(V3_BINDINGS_DIR); + let v3 = out_root.join(bindings_dir(EqlVersion::V3)); + let v4 = out_root.join(bindings_dir(EqlVersion::V4)); - let rendered = render_bindings(&dir); + let mut rendered = render_bindings(&v3); + rendered.extend(render_v4_bindings(&v4)); let targets: Vec = rendered.iter().map(|(p, _)| p.clone()).collect(); ensure_generated_paths_writable(&targets, GeneratedKind::Rust)?; @@ -897,7 +1049,9 @@ pub fn generate_bindings(out_root: &Path) -> Result, WriteError> { write_generated_file(p, body, GeneratedKind::Rust)?; written.push(p.clone()); } - remove_generated_orphans(&dir, GeneratedKind::Rust, &normalized_set(&written))?; + let keep = normalized_set(&written); + remove_generated_orphans(&v3, GeneratedKind::Rust, &keep)?; + remove_generated_orphans(&v4, GeneratedKind::Rust, &keep)?; Ok(written) } @@ -931,7 +1085,7 @@ mod tests { #[test] fn integer_family_structs_have_pinned_shape() { - let out = render_family_bindings(family("integer")); + let out = render_family_bindings(EqlVersion::V3, family("integer")); assert!(out.starts_with(crate::consts::RUST_GENERATED_MARKER)); for s in [ "struct Integer ", @@ -980,7 +1134,7 @@ mod tests { // twin = the storage struct minus `c`, on the `eql_v3.query_` // domain (prefix naming). Storage-only domains (no // operators) get no twin. - let out = render_family_bindings(family("integer")); + let out = render_family_bindings(EqlVersion::V3, family("integer")); for s in [ "struct IntegerEqQuery ", "struct IntegerOrdOreQuery ", @@ -1008,7 +1162,7 @@ mod tests { // Dual-term text domains keep BOTH terms in the query twin, still no `c`. // `_ord` and `_search` are OPE-backed (`op`); `_ord_ore` and // `_search_ore` keep `ob`. - let text = render_family_bindings(family("text")); + let text = render_family_bindings(EqlVersion::V3, family("text")); assert_eq!(field_idents(&text, "TextOrdQuery"), ["v", "i", "hm", "op"]); assert_eq!( field_idents(&text, "TextOrdOreQuery"), @@ -1031,7 +1185,7 @@ mod tests { // the capability label + the operator union (`Term::operators_for_terms`) // + the required-key list (`ENVELOPE_KEYS` ++ `Term::term_json_keys`). // No field docs, no new free-form catalog prose. - let integer = render_family_bindings(family("integer")); + let integer = render_family_bindings(EqlVersion::V3, family("integer")); // Storage-only: no operators. assert!(integer.contains("`public.eql_v3_integer` — storage-only domain.")); @@ -1053,7 +1207,7 @@ mod tests { // text_ord carries BOTH `hm` and `ob` — the dual-term distinction that // previously lived only in hand-written prose is now derivable in the doc. - let text = render_family_bindings(family("text")); + let text = render_family_bindings(EqlVersion::V3, family("text")); assert!(text.contains("Required keys: `v` `i` `c` `hm` `ob`.")); assert!(text.contains("`public.eql_v3_text_match` — match domain.")); assert!(text.contains("Operators: `@@`.")); @@ -1062,7 +1216,7 @@ mod tests { #[test] fn text_family_includes_bloom_and_dual_term_ord() { - let out = render_family_bindings(family("text")); + let out = render_family_bindings(EqlVersion::V3, family("text")); for s in [ "struct Text ", "struct TextEq ", @@ -1105,7 +1259,7 @@ mod tests { #[test] fn bool_storage_only_family_has_one_struct_no_terms() { - let out = render_family_bindings(family("boolean")); + let out = render_family_bindings(EqlVersion::V3, family("boolean")); assert_eq!(out.matches("pub struct ").count(), 1); assert!(out.contains("`public.eql_v3_boolean` — storage-only domain.")); assert_eq!(field_idents(&out, "Boolean"), ["v", "i", "c"]); @@ -1115,24 +1269,63 @@ mod tests { assert!(!out.contains("BloomFilter")); } + /// Stack Encrypt produces EQL v4 only (ADR-0002): no v3 struct derives + /// its traits, and the v4 structs that do name the v4 domain and `v: 4`. + #[test] + fn only_v4_structs_derive_stack_encrypt_traits() { + for f in eql_domains::families_with_scalar_domains() { + let v3 = if f.is_scalar() { + render_family_bindings(EqlVersion::V3, f) + } else { + render_scalar_only_bindings(EqlVersion::V3, f) + }; + assert!(!v3.contains("stack_encrypt"), "{}: v3 derives", f.name); + } + for (family, domain) in stored_payload_domains().filter(|(_, d)| d.is_scalar()) { + assert_eq!( + encryption_gap(EqlVersion::V3, family, domain), + Some(V3_ENCRYPTION_GAP) + ); + } + let text = render_family_bindings(EqlVersion::V4, family("text")); + assert!(text.contains("derive(stack_encrypt::EncryptFrom)")); + assert!(text.contains("`public.eql_v4_text_eq` — equality domain.")); + assert!(text.contains("\"eql_v4.query_text_eq\"")); + assert!(text.contains("use crate::v4::{DomainType, SchemaVersion};")); + assert!(!text.contains("eql_v3")); + } + #[test] fn generate_bindings_writes_family_files_and_inventory_with_markers() { let tmp = crate::writer::test_support::tempdir(); let written = generate_bindings(tmp.path()).unwrap(); let dir = tmp.path().join("crates/eql-bindings/src/v3"); - // scalar families + jsonb_storage + payload + query_payload + targets - // + inventory. - assert_eq!(written.len(), eql_domains::scalar_families().count() + 5); + let v4 = tmp.path().join("crates/eql-bindings/src/v4"); + // v3: scalar families + json_storage + payload + query_payload + + // inventory. v4: every family with a scalar domain + targets + + // inventory. + let families = eql_domains::scalar_families().count(); + let v4_families = eql_domains::families_with_scalar_domains().count(); + assert_eq!(written.len(), (families + 4) + (v4_families + 2)); assert!(dir.join("integer.rs").is_file()); assert!(dir.join("text.rs").is_file()); assert!(dir.join("json_storage.rs").is_file()); assert!(dir.join("payload.rs").is_file()); - assert!(dir.join("targets.rs").is_file()); assert!(dir.join("inventory.rs").is_file()); assert!( - !dir.join("mod.rs").exists(), - "mod.rs stays hand-written; not generated" + !dir.join("targets.rs").exists(), + "Stack Encrypt targets are v4 only" ); + assert!(v4.join("text.rs").is_file()); + assert!(v4.join("json.rs").is_file()); + assert!(v4.join("targets.rs").is_file()); + assert!(v4.join("inventory.rs").is_file()); + for d in [&dir, &v4] { + assert!( + !d.join("mod.rs").exists(), + "mod.rs stays hand-written; not generated" + ); + } for p in &written { let body = std::fs::read_to_string(p).unwrap(); assert!( @@ -1148,17 +1341,17 @@ mod tests { // source, so a render panic aborts before deletion. Lock in the // load-bearing property: render writes NOTHING to disk. A pre-existing // file in the target dir survives the render call untouched, and render - // returns one entry per family plus payload, query_payload, targets - // and inventory (last). + // returns one entry per family plus json_storage, payload, + // query_payload and inventory (last). let tmp = crate::writer::test_support::tempdir(); - let dir = tmp.path().join(V3_BINDINGS_DIR); + let dir = tmp.path().join(bindings_dir(EqlVersion::V3)); std::fs::create_dir_all(&dir).unwrap(); let sentinel = dir.join("integer.rs"); std::fs::write(&sentinel, "SENTINEL").unwrap(); let rendered = render_bindings(&dir); - assert_eq!(rendered.len(), eql_domains::scalar_families().count() + 5); + assert_eq!(rendered.len(), eql_domains::scalar_families().count() + 4); assert_eq!( std::fs::read_to_string(&sentinel).unwrap(), "SENTINEL", @@ -1338,7 +1531,7 @@ mod tests { // trait object (`DomainType::term_json_keys`) and validates converted // payloads through `DomainType::parse_value` — both must be emitted on // every generated scalar impl, derived from `Term::term_json_keys`. - let integer = render_family_bindings(family("integer")); + let integer = render_family_bindings(EqlVersion::V3, family("integer")); assert!(integer.contains("fn term_json_keys_static() -> Option<&'static [&'static str]>")); assert!(integer.contains("fn term_json_keys(&self) -> Option<&'static [&'static str]>")); assert!( @@ -1354,7 +1547,7 @@ mod tests { assert!(integer.contains(r#"&["op"]"#)); // Multi-term domains list keys in catalog (wire) order. - let text = render_family_bindings(family("text")); + let text = render_family_bindings(EqlVersion::V3, family("text")); assert!(text.contains(r#"&["hm", "op", "bf"]"#), "text_search keys"); assert!( text.contains(r#"&["hm", "ob", "bf"]"#), @@ -1371,7 +1564,7 @@ mod tests { // together: the leading fields of a generated struct must equal // `ENVELOPE_KEYS`, in order, so a change to the catalog's envelope keys // can't silently diverge from the emitter. - let out = render_family_bindings(family("integer")); + let out = render_family_bindings(EqlVersion::V3, family("integer")); let leading: Vec = field_idents(&out, "Integer"); let expected: Vec = eql_domains::ENVELOPE_KEYS .iter() @@ -1413,7 +1606,7 @@ mod tests { #[test] fn render_bindings_skips_non_scalar_families() { let tmp = crate::writer::test_support::tempdir(); - let dir = tmp.path().join(V3_BINDINGS_DIR); + let dir = tmp.path().join(bindings_dir(EqlVersion::V3)); let rendered = render_bindings(&dir); // The hand-written SteVec module `json.rs` is never generated... assert!( @@ -1426,9 +1619,9 @@ mod tests { rendered.iter().any(|(p, _)| p.ends_with("json_storage.rs")), "the json family's scalar storage domain must generate json_storage.rs" ); - // One file per scalar family + jsonb_storage + payload + query_payload + - // targets + inventory. - assert_eq!(rendered.len(), eql_domains::scalar_families().count() + 5); + // One file per scalar family + json_storage + payload + query_payload + + // inventory. + assert_eq!(rendered.len(), eql_domains::scalar_families().count() + 4); } #[test] @@ -1463,7 +1656,7 @@ mod tests { fn every_stored_domain_has_an_encryption_derive_or_a_reason() { let mut derived = Vec::new(); for (family, domain) in stored_payload_domains() { - match encryption_gap(family, domain) { + match encryption_gap(EqlVersion::V4, family, domain) { None => derived.push((family.name, domain.name)), // Every reason is a string literal, so "not empty" cannot // fail; what can is a reason that describes a different @@ -1498,7 +1691,9 @@ mod tests { for (family, domain) in stored_payload_domains() { let listed = ENCRYPTION_DOMAINS.contains(&(family.name, domain.name)); for query in [false, true] { - let attrs = encryption_attrs(family, domain, query).0.to_string(); + let attrs = encryption_attrs(EqlVersion::V4, family, domain, query) + .0 + .to_string(); assert_eq!( attrs.contains("stack_encrypt :: EncryptFrom"), listed, @@ -1529,7 +1724,7 @@ mod tests { terms: &[Term::Hm], shape: eql_domains::Shape::Scalar, }; - let reason = encryption_gap(&family, &hm_only).unwrap(); + let reason = encryption_gap(EqlVersion::V4, &family, &hm_only).unwrap(); assert!(reason.contains("equality-only"), "{reason}"); assert!(!reason.contains("storage-only"), "{reason}"); } diff --git a/packages/eql/crates/eql-codegen/src/go_eql.rs b/packages/eql/crates/eql-codegen/src/go_eql.rs index 0389e2921..c9ecb05b7 100644 --- a/packages/eql/crates/eql-codegen/src/go_eql.rs +++ b/packages/eql/crates/eql-codegen/src/go_eql.rs @@ -204,7 +204,7 @@ mod tests { assert_eq!(out.matches("\ntype JSON []byte\n").count(), 1); assert_eq!(out.matches("\ntype SteVecQuery []byte\n").count(), 1); // TextEq is producible and says so; TextOrdOre is not and says why. - assert!(out.contains("// TextEq is the EQL type stored in public.eql_v3_text_eq")); + assert!(out.contains("// TextEq is the EQL type stored in public.eql_v4_text_eq")); assert!(out.contains("Producible: true, Reason: \"\"")); assert!(out.contains("Name: \"TextOrdOre\"") && out.contains("CLLW")); // Every table row is one line: the shape gofmt leaves alone. diff --git a/packages/eql/crates/eql-codegen/src/targets.rs b/packages/eql/crates/eql-codegen/src/targets.rs index 959a71a86..976df60c6 100644 --- a/packages/eql/crates/eql-codegen/src/targets.rs +++ b/packages/eql/crates/eql-codegen/src/targets.rs @@ -1,9 +1,11 @@ //! The target-dispatch emitter: renders `eql_domains::CATALOG` to the -//! committed `crates/eql-bindings/src/v3/targets.rs` — the table of EQL +//! committed `crates/eql-bindings/src/v4/targets.rs` — the table of EQL //! types a Stack Encrypt data plan may name as a field target, and the //! by-name dispatch that runs a named type's own Rust plan. Generated beside -//! `inventory.rs` by the same mechanism ([`crate::bindings`]), and gated to -//! the `stack-encrypt` feature by the hand-written `v3/mod.rs`. +//! the v4 family modules by the same mechanism ([`crate::bindings`]), and +//! gated to the `stack-encrypt` feature by the hand-written `v4/mod.rs`. +//! Stack Encrypt produces EQL v4 only (ADR-0002), so every target is an +//! `eql_v4_*` domain. //! //! The table is the stack-encrypt view of the catalog: for every stored //! domain, the type's name in every language (`TextEq`), its family and @@ -28,6 +30,10 @@ use quote::{format_ident, quote}; use eql_domains::{Domain, DomainFamily, Shape, Term}; use crate::bindings::{encryption_gap, format_rs, stored_payload_domains}; +use crate::render::EqlVersion; + +/// The version every target is produced into. +const TARGET_VERSION: EqlVersion = EqlVersion::V4; /// The `IndexSpec::key()` a catalog term rides under in a plan — the /// `"eq"` / `"match"` / `"ore"` / `"ope"` strings of stack-encrypt's data @@ -68,7 +74,7 @@ fn plaintext_of(family: &str) -> Option<(&'static str, &'static str)> { /// the derived plan; the reasons are the plan's, keyed on catalog facts so /// a domain added tomorrow gets an answer. pub fn target_gap(family: &DomainFamily, domain: &Domain) -> Option<&'static str> { - encryption_gap(family, domain)?; + encryption_gap(TARGET_VERSION, family, domain)?; Some(if matches!(domain.shape, Shape::SteVec) { "the JSON index is a new operation in the engine" } else if family.name != "text" { @@ -139,8 +145,9 @@ fn row(family: &'static DomainFamily, domain: &'static Domain) -> Row { let query = if is_stevec { // The containment needle is the document's query form. Its struct // is the hand-written `SteVecQuery`; its domain is the family's - // `query` domain (`eql_v3.query_json`), read from the catalog so - // the name is spelled once. + // `query` domain (`eql_v4.query_json`), read from the catalog so + // the name is spelled once. v4 has no compiled SteVec types yet, so + // these rows are never producible. family .domains .iter() @@ -148,7 +155,11 @@ fn row(family: &'static DomainFamily, domain: &'static Domain) -> Row { .map(|needle| { ( needle.rust_struct_name(family.name), - format!("eql_v3.{}", needle.full_name(family.name)), + format!( + "{}.{}", + TARGET_VERSION.prefix(), + needle.full_name(family.name) + ), ) }) } else if domain.terms.is_empty() { @@ -156,7 +167,11 @@ fn row(family: &'static DomainFamily, domain: &'static Domain) -> Row { } else { Some(( format!("{}Query", domain.struct_ident(family.name)), - format!("eql_v3.{}", domain.query_name(family.name)), + format!( + "{}.{}", + TARGET_VERSION.prefix(), + domain.query_name(family.name) + ), )) }; Row { @@ -164,7 +179,11 @@ fn row(family: &'static DomainFamily, domain: &'static Domain) -> Row { family: family.name, suffix: suffix(domain), plaintext: plaintext(family).map(|(kind, _)| kind), - sql_domain: format!("public.{}", domain.sql_typname(family.name)), + sql_domain: format!( + "public.{}_{}", + TARGET_VERSION.prefix(), + domain.full_name(family.name) + ), indexes, query, reason: target_gap(family, domain), @@ -178,7 +197,7 @@ fn option_str(value: Option<&str>) -> TokenStream { } } -/// Render the generated `crates/eql-bindings/src/v3/targets.rs`. +/// Render the generated `crates/eql-bindings/src/v4/targets.rs`. pub fn render_targets_rs() -> String { render_targets_from(&rows()) } @@ -260,7 +279,7 @@ fn render_targets_from(rows: &[Row]) -> String { }; let mod_doc = " The EQL types a Stack Encrypt data plan may name as a field target — \ - every stored v3 domain type in eql-domains::CATALOG order, as data a \ + every stored EQL v4 domain type in eql-domains::CATALOG order, as data a \ guest serializes (`TARGETS`), with the by-name dispatch that runs a \ producible type's own Rust plan. Generated from the catalog; the \ descriptor type, the errors and the public entry points stay \ @@ -347,7 +366,7 @@ mod tests { let full = domain.full_name(family.name); assert_eq!( target_gap(family, domain).is_none(), - encryption_gap(family, domain).is_none(), + encryption_gap(TARGET_VERSION, family, domain).is_none(), "{full}: producible and derived must agree" ); if target_gap(family, domain).is_none() { @@ -466,9 +485,10 @@ mod tests { assert!(out.contains("name: \"SteVecDocument\"")); assert!(out.contains("indexes: &[\"json\"]")); assert!(out.contains("query: Some(\"SteVecQuery\")")); - assert!(out.contains("query_sql_domain: Some(\"eql_v3.query_json\")")); - assert!(out.contains("sql_domain: \"public.eql_v3_text_eq\"")); - assert!(out.contains("query_sql_domain: Some(\"eql_v3.query_text_eq\")")); + assert!(out.contains("query_sql_domain: Some(\"eql_v4.query_json\")")); + assert!(out.contains("sql_domain: \"public.eql_v4_text_eq\"")); + assert!(out.contains("query_sql_domain: Some(\"eql_v4.query_text_eq\")")); + assert!(!out.contains("eql_v3"), "every target is an eql_v4 domain"); // Exactly the producible types have dispatch arms, in all three // dispatches, and the query dispatch names the query twin. for (family, domain) in ENCRYPTION_DOMAINS.iter().map(|(f, d)| { diff --git a/packages/eql/crates/eql-codegen/tests/bindings_parity.rs b/packages/eql/crates/eql-codegen/tests/bindings_parity.rs index bc84ea39b..078357457 100644 --- a/packages/eql/crates/eql-codegen/tests/bindings_parity.rs +++ b/packages/eql/crates/eql-codegen/tests/bindings_parity.rs @@ -37,8 +37,8 @@ fn tempdir(tag: &str) -> TempDir { TempDir(p) } -/// Relative path (from repo root / generator out-root) of the v3 bindings dir. -const V3_BINDINGS_DIR: &str = "crates/eql-bindings/src/v3"; +/// Relative paths (from repo root / generator out-root) of the bindings dirs. +const BINDINGS_DIRS: [&str; 2] = ["crates/eql-bindings/src/v3", "crates/eql-bindings/src/v4"]; /// Generate the bindings into `out`, then assert each written file is /// byte-for-byte identical to the committed copy under `repo_root()`. @@ -72,7 +72,7 @@ fn rust_bindings_match_committed_files() { } /// The committed marker-bearing (`// @generated`) `.rs` file SET under -/// `crates/eql-bindings/src/v3` must equal the set the generator emits. The +/// `crates/eql-bindings/src/v3` and `src/v4` must equal the set the generator emits. The /// per-file parity test above only iterates the freshly-generated `written` /// set, so an ORPHANED committed generated file — a `.rs` left behind /// after a catalog family rename/removal — is never visited and passes `cargo @@ -91,16 +91,23 @@ fn committed_binding_set_has_no_orphans() { let generated: BTreeSet = written .iter() - .map(|p| p.file_name().unwrap().to_str().unwrap().to_string()) + .map(|p| { + let rel = p.strip_prefix(out.path()).expect("written under out-root"); + rel.to_str().unwrap().to_string() + }) .collect(); - let dir = root.join(V3_BINDINGS_DIR); - let committed: BTreeSet = fs::read_dir(&dir) - .unwrap() - .filter_map(|e| e.ok().map(|e| e.path())) - .filter(|p| p.extension().and_then(|x| x.to_str()) == Some("rs")) - .filter(|p| is_generated(p, GeneratedKind::Rust).expect("read committed binding")) - .map(|p| p.file_name().unwrap().to_str().unwrap().to_string()) + let committed: BTreeSet = BINDINGS_DIRS + .iter() + .flat_map(|dir| { + fs::read_dir(root.join(dir)) + .unwrap() + .filter_map(|e| e.ok().map(|e| e.path())) + .filter(|p| p.extension().and_then(|x| x.to_str()) == Some("rs")) + .filter(|p| is_generated(p, GeneratedKind::Rust).expect("read committed binding")) + .map(|p| p.strip_prefix(&root).unwrap().to_str().unwrap().to_string()) + .collect::>() + }) .collect(); assert_eq!( @@ -124,14 +131,18 @@ fn generate_bindings_is_deterministic_across_runs() { eql_codegen::bindings::generate_bindings(b.path()).expect("generate bindings b"); let collect = |root: &Path| -> Vec<(String, String)> { - let base = root.join(V3_BINDINGS_DIR); - let mut files: Vec<(String, String)> = fs::read_dir(&base) - .unwrap() - .filter_map(|e| e.ok().map(|e| e.path())) - .filter(|p| p.extension().and_then(|x| x.to_str()) == Some("rs")) - .map(|p| { - let name = p.file_name().unwrap().to_str().unwrap().to_string(); - (name, fs::read_to_string(&p).unwrap()) + let mut files: Vec<(String, String)> = BINDINGS_DIRS + .iter() + .flat_map(|dir| { + fs::read_dir(root.join(dir)) + .unwrap() + .filter_map(|e| e.ok().map(|e| e.path())) + .filter(|p| p.extension().and_then(|x| x.to_str()) == Some("rs")) + .map(|p| { + let name = p.strip_prefix(root).unwrap().to_str().unwrap().to_string(); + (name, fs::read_to_string(&p).unwrap()) + }) + .collect::>() }) .collect(); files.sort(); diff --git a/packages/eql/crates/eql-codegen/tests/cli.rs b/packages/eql/crates/eql-codegen/tests/cli.rs index d196d96eb..31467846c 100644 --- a/packages/eql/crates/eql-codegen/tests/cli.rs +++ b/packages/eql/crates/eql-codegen/tests/cli.rs @@ -50,7 +50,12 @@ fn bindings_subcommand_succeeds_and_reports_count() { String::from_utf8_lossy(&out.stderr) ); let stdout = String::from_utf8_lossy(&out.stdout); - let expected = eql_domains::scalar_families().count() + 5; + // v3: scalar families + json_storage + payload + query_payload + + // inventory. v4: every family with a scalar domain + targets + inventory. + let expected = eql_domains::scalar_families().count() + + 4 + + eql_domains::families_with_scalar_domains().count() + + 2; assert!( stdout.contains(&format!("bindings: ok ({expected} files)")), "expected 'bindings: ok ({expected} files)' in stdout, got:\n{stdout}" diff --git a/packages/eql/mise.toml b/packages/eql/mise.toml index e9feeb73d..233078020 100644 --- a/packages/eql/mise.toml +++ b/packages/eql/mise.toml @@ -231,7 +231,9 @@ run = "bash tasks/schemas-parity.sh" [tasks."install-hooks"] description = "Point git at the committed hooks in tasks/githooks (run once per clone) so commits touching the catalog/generated surfaces are drift-gated locally" dir = "{{config_root}}" -run = "git config core.hooksPath tasks/githooks" +# Git resolves a relative core.hooksPath against the root of the working tree, +# not this directory, so prefix the path from the root to this package. +run = 'git config core.hooksPath "$(git rev-parse --show-prefix)tasks/githooks"' [tasks."test:codegen"] description = "Run the encrypted-domain catalog + generator tests (no database required)" @@ -310,8 +312,8 @@ cargo clippy --locked -p eql-bindings -p eql-encryption-tests --all-features --a """ [tasks."test:encryption:postgres"] -description = "Install the EQL bundle built from the tree into the database EQL_TEST_DATABASE_URL names and run the stack-encrypt PostgreSQL test against it (fresh encryption, fake KMS)" -# `build` writes release/cipherstash-encrypt.sql from the SQL in the tree. The +description = "Install the EQL v4 bundle built from the tree into the database EQL_TEST_DATABASE_URL names and run the stack-encrypt PostgreSQL test against it (fresh encryption, fake KMS)" +# `build` writes release/cipherstash-encrypt-v4.sql from the SQL in the tree. The # copy under crates/eql-bindings/sql is the RELEASED bundle, rewritten only by # the lockstep version bump, so a test that installs it cannot see a SQL edit # made in the same pull request. @@ -323,7 +325,8 @@ run = """ # different databases. psql accepts a libpq conninfo string as its dbname. set -euo pipefail : "${EQL_TEST_DATABASE_URL:?set EQL_TEST_DATABASE_URL to a libpq connection string for a disposable PostgreSQL}" -psql "$EQL_TEST_DATABASE_URL" -v ON_ERROR_STOP=1 -f release/cipherstash-encrypt.sql +# Stack Encrypt writes EQL v4 only (ADR-0002), so the test runs against the v4 bundle. +psql "$EQL_TEST_DATABASE_URL" -v ON_ERROR_STOP=1 -f release/cipherstash-encrypt-v4.sql # `--ignored` selects by attribute, and cargo exits 0 on an empty selection, so # a test that loses its `#[ignore]` or is renamed would leave this task passing # on nothing. List what the filter selects before running it. @@ -363,22 +366,25 @@ tmp="$(mktemp -d)" # the ts-rs/schemars derives below need the generated structs on disk to # compile, so (unlike the TS/JSON, which export to a temp dir and swap on # success) they cannot be temp-swapped. To keep the task atomic-on-failure, -# snapshot the whole src/v3 tree (generated + hand-written) up front; if the +# snapshot the whole src/v3 and src/v4 trees (generated + hand-written) up front; if the # regen or the cargo test that follows fails or is interrupted, the trap # restores the snapshot so the working tree is left exactly as it was — never # fresh structs against stale committed TS/JSON that an automated commit could # capture. The snapshot is a filesystem copy (not `git checkout`) so a dev's # legitimate uncommitted edits survive a failed run. v3="crates/eql-bindings/src/v3" +v4="crates/eql-bindings/src/v4" bindings="crates/eql-bindings/bindings" schema="crates/eql-bindings/schema" cp -R "$v3" "$tmp/v3-snapshot" +cp -R "$v4" "$tmp/v4-snapshot" cp -R "$bindings" "$tmp/bindings-snapshot" cp -R "$schema" "$tmp/schema-snapshot" ok=0 trap 'if [ "$ok" != 1 ]; then - rm -rf "$v3" "$bindings" "$schema" + rm -rf "$v3" "$v4" "$bindings" "$schema" mv "$tmp/v3-snapshot" "$v3" + mv "$tmp/v4-snapshot" "$v4" mv "$tmp/bindings-snapshot" "$bindings" mv "$tmp/schema-snapshot" "$schema" fi @@ -406,12 +412,12 @@ set -euo pipefail # runs in contexts (test-eql.yml's Rust job, the pre-commit hook) that # provision mise tools but not pnpm/node_modules. node packages/eql/scripts/sync-generated.mjs -git diff --exit-code -- crates/eql-bindings/src/v3 crates/eql-bindings/bindings crates/eql-bindings/schema packages/eql/src/generated ../../languages/golang/encrypt/eql/eql_gen.go || { +git diff --exit-code -- crates/eql-bindings/src/v3 crates/eql-bindings/src/v4 crates/eql-bindings/bindings crates/eql-bindings/schema packages/eql/src/generated ../../languages/golang/encrypt/eql/eql_gen.go || { echo "eql-bindings generated Rust/TS/JSON, the Go package encrypt/eql or @cipherstash/eql package output is stale — run 'mise run types:generate' and 'mise run typescript:generate' and commit the result" >&2 exit 1 } # git diff is blind to brand-new files; untracked output is stale too. -untracked=$(git ls-files --others --exclude-standard -- crates/eql-bindings/src/v3 crates/eql-bindings/bindings crates/eql-bindings/schema packages/eql/src/generated ../../languages/golang/encrypt/eql/eql_gen.go) +untracked=$(git ls-files --others --exclude-standard -- crates/eql-bindings/src/v3 crates/eql-bindings/src/v4 crates/eql-bindings/bindings crates/eql-bindings/schema packages/eql/src/generated ../../languages/golang/encrypt/eql/eql_gen.go) if [ -n "$untracked" ]; then echo "eql-bindings has uncommitted generated files:" >&2 echo "$untracked" >&2 diff --git a/packages/eql/tasks/githooks/pre-commit b/packages/eql/tasks/githooks/pre-commit index 871925e5d..15c4171f4 100755 --- a/packages/eql/tasks/githooks/pre-commit +++ b/packages/eql/tasks/githooks/pre-commit @@ -13,9 +13,26 @@ # Unrelated commits skip the gate entirely, so this is a no-op for most commits. set -euo pipefail -staged=$(git diff --cached --name-only --diff-filter=ACMRD) +# Git runs a hook from the root of the working tree. In cipherstash/stack that +# is the monorepo root, not this package, so the staged paths carry a +# `packages/eql/` prefix the patterns below would never match, and `mise run` +# would not find this package's tasks. List only the staged paths under this +# package, relative to it, then work from the package root. +# +# The prefix is worked out from paths, not with `cd` and `git diff --relative`: +# git exports GIT_DIR to a hook, and with GIT_DIR set and no GIT_WORK_TREE, git +# takes the current directory as the top of the working tree, so after a `cd` +# `--relative` strips nothing. +package=$(cd "$(dirname "$0")/../.." && pwd -P) +top=$(cd "$(git rev-parse --show-toplevel)" && pwd -P) +relative=() +if [ "$package" != "$top" ]; then + relative=("--relative=${package#"$top"/}/") +fi +staged=$(git diff --cached --name-only "${relative[@]}" --diff-filter=ACMRD) +cd "$package" -if echo "$staged" | grep -Eq '^(crates/eql-domains/|crates/eql-codegen/|src/v3/scalars/|crates/eql-bindings/src/v3/|crates/eql-bindings/bindings/|crates/eql-bindings/schema/)'; then +if echo "$staged" | grep -Eq '^(crates/eql-domains/|crates/eql-codegen/|src/v3/scalars/|crates/eql-bindings/src/v3/|crates/eql-bindings/src/v4/|crates/eql-bindings/bindings/|crates/eql-bindings/schema/)'; then echo "pre-commit: catalog/generator/generated surface touched — verifying freshness…" mise run codegen:parity mise run types:check diff --git a/packages/eql/tests/encryption/fixtures/text_eq_query.json b/packages/eql/tests/encryption/fixtures/text_eq_query.json index ed65759f2..f8ac16514 100644 --- a/packages/eql/tests/encryption/fixtures/text_eq_query.json +++ b/packages/eql/tests/encryption/fixtures/text_eq_query.json @@ -2,6 +2,6 @@ "_comment": "The TextEqQuery eql-bindings derives for the plaintext under FakeDataKeySource's index key (keyset nil), read by the Go SDK's hermetic test; regenerate with EQL_UPDATE_FIXTURES=1, do not edit.", "column": "email", "plaintext": "bob@example.com", - "query": "{\"v\":3,\"i\":{\"t\":\"users\",\"c\":\"email\"},\"hm\":\"ec534cfbf2336785378c3761ff88623c46361b2ba7c5fa83930ebacae49cf646\"}", + "query": "{\"v\":4,\"i\":{\"t\":\"users\",\"c\":\"email\"},\"hm\":\"ec534cfbf2336785378c3761ff88623c46361b2ba7c5fa83930ebacae49cf646\"}", "table": "users" } diff --git a/packages/eql/tests/encryption/tests/targets.rs b/packages/eql/tests/encryption/tests/targets.rs index e5528b43a..39c06e5a1 100644 --- a/packages/eql/tests/encryption/tests/targets.rs +++ b/packages/eql/tests/encryption/tests/targets.rs @@ -6,8 +6,8 @@ mod common; use eql_bindings::encryption::targets::{self as targets, Opener, Target, TargetError}; -use eql_bindings::v3::text::{TextEq, TextEqQuery}; -use eql_bindings::{v3, Identifier}; +use eql_bindings::v4::text::{TextEq, TextEqQuery}; +use eql_bindings::{v4, Identifier}; use eql_domains::{Shape, Term, CATALOG}; use stack_encrypt::Label; use vitaminc_aead_value::{FfiValue, ValueKind}; @@ -284,6 +284,36 @@ mod given_text_eq { } } + /// Earlier builds wrote Stack Encrypt payloads with `"v": 3` and the same + /// ciphertext prefix. A real, well-formed v4 payload with only its version + /// changed is refused, so the version alone is what refuses it. + #[tokio::test] + async fn refuses_a_stored_payload_of_the_other_version() { + let (cipher, _) = common::cipher().await; + let keyset = cipher.default_keyset(); + let stored = targets::encrypt("TextEq", &keyset, &email(), text("secret")) + .unwrap() + .await + .unwrap(); + let mut payload: serde_json::Value = serde_json::from_slice(&stored).unwrap(); + assert_eq!(payload["v"], 4); + payload["v"] = 3.into(); + let as_v3 = serde_json::to_vec(&payload).unwrap(); + + let error = refused(targets::decrypt("TextEq", &cipher, &email(), &as_v3)); + assert!( + matches!( + error, + TargetError::Stored { + target: "TextEq", + .. + } + ), + "{error}" + ); + assert!(error.to_string().contains("version 3"), "{error}"); + } + #[tokio::test] async fn refuses_a_label_that_is_not_a_column() { let (cipher, _) = common::cipher().await; @@ -420,7 +450,7 @@ mod the_table { assert_eq!(row.family, family.name, "{name}: family"); assert_eq!( row.sql_domain, - format!("public.{}", domain.sql_typname(family.name)), + format!("public.eql_v4_{}", domain.full_name(family.name)), "{name}: stored domain" ); let indexes: Vec<&str> = if matches!(domain.shape, Shape::SteVec) { @@ -458,7 +488,7 @@ mod the_table { Some("SteVecQuery"), "{name}: the containment needle" ); - assert_eq!(row.query_sql_domain, Some("eql_v3.query_json"), "{name}"); + assert_eq!(row.query_sql_domain, Some("eql_v4.query_json"), "{name}"); } else if domain.terms.is_empty() { assert_eq!( (row.query, row.query_sql_domain), @@ -473,7 +503,7 @@ mod the_table { ); assert_eq!( row.query_sql_domain.map(str::to_owned), - Some(format!("eql_v3.{}", domain.query_name(family.name))), + Some(format!("eql_v4.{}", domain.query_name(family.name))), "{name}: query domain" ); } @@ -482,9 +512,21 @@ mod the_table { #[test] fn every_row_is_a_compiled_domain_type_and_so_is_its_query() { - let stored: Vec<&str> = v3::all().iter().map(|d| d.sql_domain()).collect(); - let queries: Vec<&str> = v3::all_query().iter().map(|d| d.sql_domain()).collect(); + let stored: Vec<&str> = v4::all().iter().map(|d| d.sql_domain()).collect(); + let queries: Vec<&str> = v4::all_query().iter().map(|d| d.sql_domain()).collect(); + // v4 has no SteVec bindings yet, so the SteVec rows (the document + // and its `SteVecQuery` needle) have no compiled type behind them. + // They must stay unproducible, so neither Rust's `encrypt`/`query` + // nor a generator such as Go's can select them. for row in targets::targets() { + if row.query == Some("SteVecQuery") { + assert!( + !row.producible, + "{}: a SteVec row has no v4 type and must not be producible", + row.name + ); + continue; + } assert!( stored.contains(&row.sql_domain), "{}: {} is in all()", @@ -492,10 +534,8 @@ mod the_table { row.sql_domain ); if let Some(query) = row.query_sql_domain { - // The SteVec needle is in `all()`, not `all_query()`: it is - // a hand-written document shape, not a scalar twin. assert!( - queries.contains(&query) || stored.contains(&query), + queries.contains(&query), "{}: {query} is a compiled domain type", row.name ); @@ -541,10 +581,10 @@ mod the_table { "family": "text", "suffix": "Eq", "plaintext": "string", - "sql_domain": "public.eql_v3_text_eq", + "sql_domain": "public.eql_v4_text_eq", "indexes": ["eq"], "query": "TextEqQuery", - "query_sql_domain": "eql_v3.query_text_eq", + "query_sql_domain": "eql_v4.query_text_eq", "producible": true, "reason": null }) diff --git a/packages/eql/tests/encryption/tests/text_eq.rs b/packages/eql/tests/encryption/tests/text_eq.rs index 86a2a2395..d1bffd753 100644 --- a/packages/eql/tests/encryption/tests/text_eq.rs +++ b/packages/eql/tests/encryption/tests/text_eq.rs @@ -3,8 +3,9 @@ mod common; use base64::{engine::general_purpose::STANDARD, Engine as _}; use eql_bindings::encryption::NativeCiphertextVisitor as NativeLeaf; use eql_bindings::v3::terms::{Ciphertext, Hmac256}; -use eql_bindings::v3::text::{TextEq, TextEqQuery}; -use eql_bindings::{Identifier, SchemaVersion}; +use eql_bindings::v4::text::{TextEq, TextEqQuery}; +use eql_bindings::v4::SchemaVersion; +use eql_bindings::Identifier; use stack_encrypt::target::transcode::{Reader, Transcode}; use stack_encrypt::{Cipher, Encrypt, IntoAad, NonEmpty}; @@ -27,11 +28,12 @@ async fn text_round_trips_through_json_and_both_canonical_directions() { let value = text.to_owned(); let stored: TextEq = keyset.encrypt_as(&value, column()).await.unwrap(); let json = serde_json::to_value(&stored).unwrap(); - assert_eq!(json["v"], 3); + assert_eq!(json["v"], 4, "Stack Encrypt writes EQL v4"); assert_eq!(json["i"], serde_json::json!({"t":"users", "c":"email"})); assert_eq!(json.as_object().unwrap().len(), 4); - // The marker is the only thing that separates this producer profile - // from cipherstash-client ciphertext in the same column. Encryption + // The marker is what separates this producer profile from + // cipherstash-client ciphertext inside the payload; the `eql_v4` + // domain separates them in the database. Encryption // and decryption read one constant, so a round trip cannot notice it // changing; rows written under the old text would then stop opening. let encoded = json["c"].as_str().unwrap(); @@ -313,9 +315,9 @@ async fn leaf_transcoding_requires_no_serde_and_refuses_container_shapes() { .is_err()); } -/// Needs an EQL v3 installation; uses fresh real ciphertext with a fake key source. +/// Needs an EQL v4 installation; uses fresh real ciphertext with a fake key source. #[test] -#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v3 database"] +#[ignore = "requires EQL_TEST_DATABASE_URL pointing to an EQL v4 database"] fn postgres_stores_queries_indexes_and_returns_decryptable_text() { let runtime = tokio::runtime::Builder::new_current_thread() .enable_all() @@ -329,8 +331,8 @@ fn postgres_stores_queries_indexes_and_returns_decryptable_text() { ) .unwrap(); db.batch_execute( - "CREATE TEMP TABLE text_eq_roundtrip (id int PRIMARY KEY, email public.eql_v3_text_eq); - CREATE INDEX text_eq_email_idx ON text_eq_roundtrip (eql_v3.eq_term(email));", + "CREATE TEMP TABLE text_eq_roundtrip (id int PRIMARY KEY, email public.eql_v4_text_eq); + CREATE INDEX text_eq_email_idx ON text_eq_roundtrip (eql_v4.eq_term(email));", ) .unwrap(); for (id, value) in [ @@ -344,7 +346,7 @@ fn postgres_stores_queries_indexes_and_returns_decryptable_text() { .unwrap(); let json = serde_json::to_string(&record).unwrap(); db.execute( - "INSERT INTO text_eq_roundtrip VALUES ($1, $2::text::jsonb::public.eql_v3_text_eq)", + "INSERT INTO text_eq_roundtrip VALUES ($1, $2::text::jsonb::public.eql_v4_text_eq)", &[&id, &json], ) .unwrap(); @@ -359,7 +361,7 @@ fn postgres_stores_queries_indexes_and_returns_decryptable_text() { }) .unwrap(); let json = serde_json::to_string(&query).unwrap(); - let rows = db.query("SELECT id, email::text FROM text_eq_roundtrip WHERE email = $1::text::jsonb::eql_v3.query_text_eq ORDER BY id", &[&json]).unwrap(); + let rows = db.query("SELECT id, email::text FROM text_eq_roundtrip WHERE email = $1::text::jsonb::eql_v4.query_text_eq ORDER BY id", &[&json]).unwrap(); assert_eq!( rows.iter().map(|r| r.get::<_, i32>(0)).collect::>(), [1, 3] @@ -371,7 +373,7 @@ fn postgres_stores_queries_indexes_and_returns_decryptable_text() { .unwrap(); assert_eq!(value, "alice@example.com"); } - let different = db.query("SELECT id FROM text_eq_roundtrip WHERE email <> $1::text::jsonb::eql_v3.query_text_eq ORDER BY id", &[&json]).unwrap(); + let different = db.query("SELECT id FROM text_eq_roundtrip WHERE email <> $1::text::jsonb::eql_v4.query_text_eq ORDER BY id", &[&json]).unwrap(); assert_eq!( different .iter() @@ -380,7 +382,7 @@ fn postgres_stores_queries_indexes_and_returns_decryptable_text() { [2, 4] ); db.batch_execute("SET enable_seqscan = off").unwrap(); - let plan = db.query("EXPLAIN SELECT * FROM text_eq_roundtrip WHERE email = $1::text::jsonb::eql_v3.query_text_eq", &[&json]).unwrap(); + let plan = db.query("EXPLAIN SELECT * FROM text_eq_roundtrip WHERE email = $1::text::jsonb::eql_v4.query_text_eq", &[&json]).unwrap(); assert!( plan.iter() .any(|r| r.get::<_, &str>(0).contains("text_eq_email_idx")), diff --git a/packages/stack-encrypt/fuzz/fuzz_targets/check_record.rs b/packages/stack-encrypt/fuzz/fuzz_targets/check_record.rs index 39e2a375d..7b486afc5 100644 --- a/packages/stack-encrypt/fuzz/fuzz_targets/check_record.rs +++ b/packages/stack-encrypt/fuzz/fuzz_targets/check_record.rs @@ -50,10 +50,10 @@ impl TargetResolver for Fixed { "text", "Eq", Some(ValueKind::String), - "public.eql_v3_text_eq", + "public.eql_v4_text_eq", vec!["eq".to_string()], Some("TextEqQuery".to_string()), - Some("eql_v3.query_text_eq".to_string()), + Some("eql_v4.query_text_eq".to_string()), true, None, )] diff --git a/packages/stack-encrypt/src/dynamic/record.rs b/packages/stack-encrypt/src/dynamic/record.rs index 0093b9f53..5625a9731 100644 --- a/packages/stack-encrypt/src/dynamic/record.rs +++ b/packages/stack-encrypt/src/dynamic/record.rs @@ -5182,10 +5182,10 @@ mod tests { "text", "Eq", Some(ValueKind::String), - "public.eql_v3_text_eq", + "public.eql_v4_text_eq", vec!["eq".to_string()], Some("TextEqQuery".to_string()), - Some("eql_v3.query_text_eq".to_string()), + Some("eql_v4.query_text_eq".to_string()), true, None, ), @@ -5194,10 +5194,10 @@ mod tests { "text", "OrdOre", Some(ValueKind::String), - "public.eql_v3_text_ord_ore", + "public.eql_v4_text_ord_ore", vec!["eq".to_string(), "ore".to_string()], Some("TextOrdOreQuery".to_string()), - Some("eql_v3.query_text_ord_ore".to_string()), + Some("eql_v4.query_text_ord_ore".to_string()), false, Some("block ORE is not CLLW ORE".to_string()), ), diff --git a/packages/stack-encrypt/src/dynamic/target.rs b/packages/stack-encrypt/src/dynamic/target.rs index 858f61f0d..d533edc43 100644 --- a/packages/stack-encrypt/src/dynamic/target.rs +++ b/packages/stack-encrypt/src/dynamic/target.rs @@ -526,10 +526,10 @@ mod tests { "text", "Eq", Some(ValueKind::String), - "public.eql_v3_text_eq", + "public.eql_v4_text_eq", vec!["eq".to_string()], Some("TextEqQuery".to_string()), - Some("eql_v3.query_text_eq".to_string()), + Some("eql_v4.query_text_eq".to_string()), true, None, ) @@ -541,10 +541,10 @@ mod tests { "text", "OrdOre", Some(ValueKind::String), - "public.eql_v3_text_ord_ore", + "public.eql_v4_text_ord_ore", vec!["eq".to_string(), "ore".to_string()], Some("TextOrdOreQuery".to_string()), - Some("eql_v3.query_text_ord_ore".to_string()), + Some("eql_v4.query_text_ord_ore".to_string()), false, Some("block ORE is not CLLW ORE".to_string()), )