From ebda37ed33f4dcd1debeeecd4ccf550a85506463 Mon Sep 17 00:00:00 2001 From: Lindsay Holmwood Date: Fri, 27 Nov 2026 00:56:49 +1100 Subject: [PATCH 1/2] docs(golang): give the sort expression for each ordered EQL type Each EQL type is a PostgreSQL domain over jsonb. So a plain ORDER BY col sorts the stored JSON, and returns rows in the wrong order with no error. The type table said ordered types support ORDER BY. It now gives the expression that sorts correctly for each type: - eql_v4.ord_term(col) for the Ord, OrdOpe, and TextSearch types. - eql_v4.ord_term_ore(col) for the OrdOre and TextSearchOre types. On these, ord_term fails with "function is not unique". The package documentation says the same. The README said that a decimal, date, or timestamp field takes an equality index only. stashgen accepts an ore or ope index on all three. It writes the Lt, Lte, Gt, Gte, and Between methods for them. The type and query tables now say so. The package documentation said ORE and OPE apply to bytes. stashgen refuses an order index on bytes, so that claim is removed. Refs #1851 Refs #1855 Refs #1857 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CtEQzxj55RUn35dkbhdwQk --- languages/golang/CHANGELOG.md | 15 +++++++++ languages/golang/encrypt/README.md | 53 ++++++++++++++++++++---------- languages/golang/encrypt/doc.go | 20 +++++++---- 3 files changed, 64 insertions(+), 24 deletions(-) diff --git a/languages/golang/CHANGELOG.md b/languages/golang/CHANGELOG.md index bd7ebcd19..470d7740d 100644 --- a/languages/golang/CHANGELOG.md +++ b/languages/golang/CHANGELOG.md @@ -13,6 +13,21 @@ and `languages/golang/encrypt/encrypttest/vX.Y.Z` on the same commit. ## [Unreleased] +### Fixed + +- The EQL type table in the `encrypt` README now gives the sort expression + for each ordered type. Sort an `Ord`, `OrdOpe`, or `TextSearch` column with + `ORDER BY eql_v4.ord_term(col)`, and an `OrdOre` or `TextSearchOre` column + with `ORDER BY eql_v4.ord_term_ore(col)`. The table used to say + `ORDER BY`, but a plain `ORDER BY col` returns rows in the wrong order, + with no error. The package documentation now says the same. +- The `encrypt` README now says that an `encrypt.Decimal`, an + `encrypt.Date`, and a `time.Time` field can take an `ore` or `ope` index. + The README used to say they take `equality` only. +- The `encrypt` package documentation no longer says that ORE and OPE + indexes apply to bytes. `stashgen` refuses an order index on a `[]byte` + field. + ## [0.1.0-rc.7] - 2026-11-25 ### Upgrading from rc.6 diff --git a/languages/golang/encrypt/README.md b/languages/golang/encrypt/README.md index 6e67a1e8a..43162ffd2 100644 --- a/languages/golang/encrypt/README.md +++ b/languages/golang/encrypt/README.md @@ -377,9 +377,9 @@ or a type defined over one (`type Email string`): | `int8`, `uint8` (`byte`) | an 8-bit integer | `equality` | `Eq` | | `encrypt.Int128`, `encrypt.Uint128` | a 128-bit integer | `equality`, `ore`, `ope` | the same | | `float32`, `float64` | a float of its width | `equality`, `ore`, `ope` | `Eq`, `Lt`, `Lte`, `Gt`, `Gte`, `Between` | -| `encrypt.Decimal` | a decimal: a 96-bit coefficient and a scale up to 28 | `equality` | `Eq` | -| `encrypt.Date` | a calendar date | `equality` | `Eq` | -| `time.Time` | a timestamp, to the nanosecond, in UTC | `equality` | `Eq` | +| `encrypt.Decimal` | a decimal: a 96-bit coefficient and a scale up to 28 | `equality`, `ore`, `ope` | `Eq`, `Lt`, `Lte`, `Gt`, `Gte`, `Between` | +| `encrypt.Date` | a calendar date | `equality`, `ore`, `ope` | the same | +| `time.Time` | a timestamp, to the nanosecond, in UTC | `equality`, `ore`, `ope` | the same | Each query method needs its index declared. A field of bytes takes no `ore` or `ope` index: the engine answers no ordering over bytes, so the term @@ -401,9 +401,9 @@ index: with 256 values, an order term would rank every row among 256, which a few known rows resolve to the values, as a `bool`'s would say which rows are true. Equality follows vitaminc's normalisation: an integer equals itself at every width, decimals compare at any scale -(`1.50 = 1.5`), and a timestamp compares to the microsecond, truncated, never rounded. An order index on -a decimal, date or timestamp is refused for now: the engine derives no -order term for those kinds yet. +(`1.50 = 1.5`), and a timestamp compares to the microsecond, truncated, never rounded. An order index +follows the same rules: a decimal orders by value, a date by the day, and a +timestamp by the microsecond. A `match` index stores text with no token (an empty string, separator-only text, or text shorter than the n-gram length of 3 characters) as the empty @@ -443,7 +443,7 @@ rules. | The field declares | Methods | Each returns | |---|---|---| | `index=equality` | `Eq` | `encrypt.EqualityTerm` | -| `index=ore` or `index=ope`, on an integer of 16 bits or wider or a string | `Lt`, `Lte`, `Gt`, `Gte` | `encrypt.OreTerm`, or `encrypt.OpeTerm` when the field declares no `ore` | +| `index=ore` or `index=ope`, on an integer of 16 bits or wider, a float, a string, an `encrypt.Decimal`, an `encrypt.Date` or a `time.Time` | `Lt`, `Lte`, `Gt`, `Gte` | `encrypt.OreTerm`, or `encrypt.OpeTerm` when the field declares no `ore` | | the same | `Between(ctx, cipher, lo, hi)` | `encrypt.Range[encrypt.OreTerm]` or `encrypt.Range[encrypt.OpeTerm]`, the two bounds' terms | | `index=match`, on a string | `Matches` | `encrypt.MatchQuery[T]` | | `encrypt_into=TextEq` | `Eq` | `eql.TextEqQuery` | @@ -619,38 +619,57 @@ an `eql_v4_*` column needs the v4 domains. The EQL types the engine produces, and the Go field types each takes: +> **Take care** +> +> Sort an ordered column by its order term, with the expression in the +> table. A plain `ORDER BY col` returns rows in the wrong order, with no +> error. Each EQL type is a domain over `jsonb`, so PostgreSQL sorts the +> stored JSON, not the values. On an `OrdOre` or `TextSearchOre` column, +> `eql_v4.ord_term(col)` fails with "function is not unique". Use +> `eql_v4.ord_term_ore(col)` there. + | EQL type | Go field | Queries | |---|---|---| | `TextEq` | `string` | `=`, `<>` | | `TextMatch` | `string` | `@@` (3-grams and whole two-letter words, case-insensitive; see below) | -| `TextOrd`, `TextOrdOpe`, `TextOrdOre` | `string` | `=`, `<>`, `<`, `<=`, `>`, `>=`, `ORDER BY` | -| `TextSearch`, `TextSearchOre` | `string` | `=`, `<>`, `<`, `<=`, `>`, `>=`, `ORDER BY`, `@@` | +| `TextOrd`, `TextOrdOpe` | `string` | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term(col)` | +| `TextOrdOre` | `string` | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | +| `TextSearch` | `string` | `=`, `<>`, `<`, `<=`, `>`, `>=`, `@@`; sort with `ORDER BY eql_v4.ord_term(col)` | +| `TextSearchOre` | `string` | `=`, `<>`, `<`, `<=`, `>`, `>=`, `@@`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | | `Text` | `string` | none: stored and read only | | `Smallint` | `int16`, or any Go integer type (see below) | none | | `SmallintEq` | the same | `=`, `<>` | -| `SmallintOrd`, `SmallintOrdOpe`, `SmallintOrdOre` | the same | `=`, `<>`, `<`, `<=`, `>`, `>=`, `ORDER BY` | +| `SmallintOrd`, `SmallintOrdOpe` | the same | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term(col)` | +| `SmallintOrdOre` | the same | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | | `Integer` | `int32`, or any Go integer type (see below) | none | | `IntegerEq` | the same | `=`, `<>` | -| `IntegerOrd`, `IntegerOrdOpe`, `IntegerOrdOre` | the same | `=`, `<>`, `<`, `<=`, `>`, `>=`, `ORDER BY` | +| `IntegerOrd`, `IntegerOrdOpe` | the same | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term(col)` | +| `IntegerOrdOre` | the same | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | | `Bigint` | `int64`, or any Go integer type | none | | `BigintEq` | the same | `=`, `<>` | -| `BigintOrd`, `BigintOrdOpe`, `BigintOrdOre` | the same | `=`, `<>`, `<`, `<=`, `>`, `>=`, `ORDER BY` | +| `BigintOrd`, `BigintOrdOpe` | the same | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term(col)` | +| `BigintOrdOre` | the same | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | | `Boolean` | `bool` | none | | `Real` | `float32` | none | | `RealEq` | `float32` | `=`, `<>` | -| `RealOrd`, `RealOrdOpe`, `RealOrdOre` | `float32` | `=`, `<>`, `<`, `<=`, `>`, `>=`, `ORDER BY` | +| `RealOrd`, `RealOrdOpe` | `float32` | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term(col)` | +| `RealOrdOre` | `float32` | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | | `Double` | `float64` | none | | `DoubleEq` | `float64` | `=`, `<>` | -| `DoubleOrd`, `DoubleOrdOpe`, `DoubleOrdOre` | `float64` | `=`, `<>`, `<`, `<=`, `>`, `>=`, `ORDER BY` | +| `DoubleOrd`, `DoubleOrdOpe` | `float64` | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term(col)` | +| `DoubleOrdOre` | `float64` | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | | `Date` | `encrypt.Date` | none | | `DateEq` | `encrypt.Date` | `=`, `<>` | -| `DateOrd`, `DateOrdOpe`, `DateOrdOre` | `encrypt.Date` | `<`, `<=`, `>`, `>=`, `ORDER BY` | +| `DateOrd`, `DateOrdOpe` | `encrypt.Date` | `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term(col)` | +| `DateOrdOre` | `encrypt.Date` | `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | | `Timestamp` | `time.Time` | none | | `TimestampEq` | `time.Time` | `=`, `<>` (to the microsecond, truncated) | -| `TimestampOrd`, `TimestampOrdOpe`, `TimestampOrdOre` | `time.Time` | `<`, `<=`, `>`, `>=`, `ORDER BY` | +| `TimestampOrd`, `TimestampOrdOpe` | `time.Time` | `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term(col)` | +| `TimestampOrdOre` | `time.Time` | `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | | `Numeric` | `encrypt.Decimal` | none | | `NumericEq` | `encrypt.Decimal` | `=`, `<>` (`1.5 = 1.50`) | -| `NumericOrd`, `NumericOrdOpe`, `NumericOrdOre` | `encrypt.Decimal` | `<`, `<=`, `>`, `>=`, `ORDER BY` | +| `NumericOrd`, `NumericOrdOpe` | `encrypt.Decimal` | `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term(col)` | +| `NumericOrdOre` | `encrypt.Decimal` | `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | | `Json` (`eql.JSON`) | struct, map, slice, or `json.RawMessage` | none: the document is one ciphertext, stored and read back whole; see [Encrypted JSON documents](#encrypted-json-documents) | | `JsonSearch` (`eql.JSONSearch`) | struct, map, slice, or `json.RawMessage` | containment, equality at a path, ordering at declared paths, several members of one array element, selection, subtree reads; see [Encrypted JSON documents](#encrypted-json-documents) | diff --git a/languages/golang/encrypt/doc.go b/languages/golang/encrypt/doc.go index 3003f54b6..80c151199 100644 --- a/languages/golang/encrypt/doc.go +++ b/languages/golang/encrypt/doc.go @@ -31,11 +31,16 @@ // also takes any other built-in Go integer type, sealed at the type's width: // one every value of which fits it (an int16 into Integer) always seals, and // a wider one (an int64 into Integer) is range checked, a value that does not -// fit refused with [ErrEncoding]. The *Eq types answer Eq; the *Ord and +// fit refused with [ErrEncoding]. The *Eq types answer Eq. The *Ord and // *OrdOpe types (IntegerOrd, SmallintOrd, BigintOrd, RealOrd, DoubleOrd, -// TextOrd and their OrdOpe twins) answer Lt, Lte, Gt and Gte, and Eq too on -// text; Smallint, Integer, Bigint, Boolean, Real, Double, Text, Date, -// Timestamp and Numeric are stored and read only. NumericEq compares +// TextOrd, DateOrd, TimestampOrd, NumericOrd and their OrdOpe twins) answer +// Lt, Lte, Gt and Gte, and Eq too on text. Smallint, Integer, Bigint, +// Boolean, Real, Double, Text, Date, Timestamp and Numeric are stored and +// read only. Sort an *Ord, *OrdOpe or TextSearch column with ORDER BY +// eql_v4.ord_term(col), and an *OrdOre or TextSearchOre column with ORDER +// BY eql_v4.ord_term_ore(col). A plain ORDER BY col returns rows in the +// wrong order, with no error, because PostgreSQL sorts the stored JSON, not +// the values. NumericEq compares // decimals with their scale normalised (1.5 = 1.50), and TimestampEq // compares instants to the microsecond, truncated, never rounded. // @@ -128,9 +133,10 @@ // time.Time (a timestamp), or a type defined over one of the built-in types. // Each integer seals at its own width. Equality applies to every one but a // bool. ORE and OPE apply to integers of 16 bits or more, floats, text, -// bytes, decimals, dates and timestamps. A bool or an 8-bit integer takes no -// order index, since over so few values its ordering terms would show which -// rows hold which value. +// decimals, dates and timestamps. A bool or an 8-bit integer takes no order +// index, since over so few values its ordering terms would show which rows +// hold which value. stashgen refuses an order index on bytes, because the +// engine answers no ordering over bytes. // // Passthrough fields never cross the binding: the engine does nothing to a // passthrough value that a program could observe, and the FFI codec cannot From 99408387c45e7a29361c9c663ab86fad736cae84 Mon Sep 17 00:00:00 2001 From: Lindsay Holmwood Date: Fri, 27 Nov 2026 01:39:04 +1100 Subject: [PATCH 2/2] docs(golang): list every ordered EQL type and its operators Review found four gaps in the type docs. - The README said an order index follows the equality rules. Those rules say an integer equals itself at every width. But each integer width has its own order term, so the sentence now covers decimals, dates, and timestamps only. - The ordered Date, Timestamp, and Numeric rows left out = and <>. EQL v4 defines both on those domains. - The package docs left out the OrdOre types, TextSearch, and TextSearchOre, from both the Go field types and the operators. The Go field types are now a list by family. - The paragraphs are wrapped again at the file's width. Refs #1851 Refs #1855 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CtEQzxj55RUn35dkbhdwQk --- languages/golang/encrypt/README.md | 19 ++++++----- languages/golang/encrypt/doc.go | 53 +++++++++++++++++++----------- 2 files changed, 43 insertions(+), 29 deletions(-) diff --git a/languages/golang/encrypt/README.md b/languages/golang/encrypt/README.md index 43162ffd2..59a684319 100644 --- a/languages/golang/encrypt/README.md +++ b/languages/golang/encrypt/README.md @@ -401,9 +401,10 @@ index: with 256 values, an order term would rank every row among 256, which a few known rows resolve to the values, as a `bool`'s would say which rows are true. Equality follows vitaminc's normalisation: an integer equals itself at every width, decimals compare at any scale -(`1.50 = 1.5`), and a timestamp compares to the microsecond, truncated, never rounded. An order index -follows the same rules: a decimal orders by value, a date by the day, and a -timestamp by the microsecond. +(`1.50 = 1.5`), and a timestamp compares to the microsecond, truncated, +never rounded. An order index on a decimal, date or timestamp follows the +same rules. A decimal orders by value, a date by the day, and a timestamp +by the microsecond. An integer's order term depends on its width. A `match` index stores text with no token (an empty string, separator-only text, or text shorter than the n-gram length of 3 characters) as the empty @@ -660,16 +661,16 @@ The EQL types the engine produces, and the Go field types each takes: | `DoubleOrdOre` | `float64` | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | | `Date` | `encrypt.Date` | none | | `DateEq` | `encrypt.Date` | `=`, `<>` | -| `DateOrd`, `DateOrdOpe` | `encrypt.Date` | `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term(col)` | -| `DateOrdOre` | `encrypt.Date` | `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | +| `DateOrd`, `DateOrdOpe` | `encrypt.Date` | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term(col)` | +| `DateOrdOre` | `encrypt.Date` | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | | `Timestamp` | `time.Time` | none | | `TimestampEq` | `time.Time` | `=`, `<>` (to the microsecond, truncated) | -| `TimestampOrd`, `TimestampOrdOpe` | `time.Time` | `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term(col)` | -| `TimestampOrdOre` | `time.Time` | `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | +| `TimestampOrd`, `TimestampOrdOpe` | `time.Time` | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term(col)` | +| `TimestampOrdOre` | `time.Time` | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | | `Numeric` | `encrypt.Decimal` | none | | `NumericEq` | `encrypt.Decimal` | `=`, `<>` (`1.5 = 1.50`) | -| `NumericOrd`, `NumericOrdOpe` | `encrypt.Decimal` | `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term(col)` | -| `NumericOrdOre` | `encrypt.Decimal` | `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | +| `NumericOrd`, `NumericOrdOpe` | `encrypt.Decimal` | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term(col)` | +| `NumericOrdOre` | `encrypt.Decimal` | `=`, `<>`, `<`, `<=`, `>`, `>=`; sort with `ORDER BY eql_v4.ord_term_ore(col)` | | `Json` (`eql.JSON`) | struct, map, slice, or `json.RawMessage` | none: the document is one ciphertext, stored and read back whole; see [Encrypted JSON documents](#encrypted-json-documents) | | `JsonSearch` (`eql.JSONSearch`) | struct, map, slice, or `json.RawMessage` | containment, equality at a path, ordering at declared paths, several members of one array element, selection, subtree reads; see [Encrypted JSON documents](#encrypted-json-documents) | diff --git a/languages/golang/encrypt/doc.go b/languages/golang/encrypt/doc.go index 80c151199..3cb77af9e 100644 --- a/languages/golang/encrypt/doc.go +++ b/languages/golang/encrypt/doc.go @@ -23,26 +23,39 @@ // } // // encrypt_into names the EQL type the field is stored as. The Go field type -// must match it: TextEq, TextMatch and Text take a string, Smallint and -// SmallintEq an int16, Integer and IntegerEq an int32, Bigint and BigintEq -// an int64, Boolean a bool, Real and RealEq a float32, Double and DoubleEq a -// float64, Date and DateEq a [Date], Timestamp and TimestampEq a time.Time, -// and Numeric and NumericEq a [Decimal]. An integer EQL type -// also takes any other built-in Go integer type, sealed at the type's width: -// one every value of which fits it (an int16 into Integer) always seals, and -// a wider one (an int64 into Integer) is range checked, a value that does not -// fit refused with [ErrEncoding]. The *Eq types answer Eq. The *Ord and -// *OrdOpe types (IntegerOrd, SmallintOrd, BigintOrd, RealOrd, DoubleOrd, -// TextOrd, DateOrd, TimestampOrd, NumericOrd and their OrdOpe twins) answer -// Lt, Lte, Gt and Gte, and Eq too on text. Smallint, Integer, Bigint, -// Boolean, Real, Double, Text, Date, Timestamp and Numeric are stored and -// read only. Sort an *Ord, *OrdOpe or TextSearch column with ORDER BY -// eql_v4.ord_term(col), and an *OrdOre or TextSearchOre column with ORDER -// BY eql_v4.ord_term_ore(col). A plain ORDER BY col returns rows in the -// wrong order, with no error, because PostgreSQL sorts the stored JSON, not -// the values. NumericEq compares -// decimals with their scale normalised (1.5 = 1.50), and TimestampEq -// compares instants to the microsecond, truncated, never rounded. +// must match the EQL type's family: +// +// - Text, TextMatch, TextSearch and TextSearchOre: a string +// - Smallint: an int16 +// - Integer: an int32 +// - Bigint: an int64 +// - Real: a float32 +// - Double: a float64 +// - Date: a [Date] +// - Timestamp: a time.Time +// - Numeric: a [Decimal] +// - Boolean: a bool +// +// A family is the plain type and its Eq, Ord, OrdOpe and OrdOre types, such +// as Integer, IntegerEq, IntegerOrd, IntegerOrdOpe and IntegerOrdOre. An +// integer EQL type also takes any other built-in Go integer type, sealed at +// the type's width: one every value of which fits it (an int16 into Integer) +// always seals, and a wider one (an int64 into Integer) is range checked, a +// value that does not fit refused with [ErrEncoding]. +// +// The *Eq types answer Eq. The *Ord, *OrdOpe and *OrdOre types answer Lt, +// Lte, Gt and Gte, and Eq too on text. TextSearch and TextSearchOre answer +// Eq, Lt, Lte, Gt, Gte and Matches. Smallint, Integer, Bigint, Boolean, +// Real, Double, Text, Date, Timestamp and Numeric are stored and read only. +// NumericEq compares decimals with their scale normalised (1.5 = 1.50), and +// TimestampEq compares instants to the microsecond, truncated, never +// rounded. +// +// Sort an *Ord, *OrdOpe or TextSearch column with ORDER BY +// eql_v4.ord_term(col), and an *OrdOre or TextSearchOre column with ORDER BY +// eql_v4.ord_term_ore(col). A plain ORDER BY col returns rows in the wrong +// order, with no error, because PostgreSQL sorts the stored JSON, not the +// values. // // 3. Run the generator. It writes user_stash.go beside the struct: //