Public repository: timo / feel

Reader

An interpreter of FEEL, written in Rust, with integrations for PostgreSQL, WASM, Lua, and Python.

refactor(core): simplify evaluation entry points to single general method

public

refactor(core): simplify evaluation entry points to single general method

Consolidates the evaluation API in `feel-core` to a single general entry point:
`CompiledExpr::evaluate_with_env`. Removes redundant `evaluate_with` and
`evaluate` convenience methods. Updates core library, regex provider, and
PostgreSQL wrapper documentation to reference the unified API.

Documents the dependency purity invariant (I1) and result determinism invariant
(I2) in DECISIONS.md, and adds the planned Lua wrapper (mlua) to the README's
architecture invariant verification command.
Changeset480c303d3aad301fa1795f060ebe80b013e7be5f
Author (claimed)Timo Stolz <timo.stolz@gmail.com>,
Parents995047acb973
Children
Pushlog
by timo via ssh

modified DECISIONS.md +177 −12

@@ -6,15 +6,28 @@
66
 
77
 ## ADR-1: `feel-core` has no target-specific dependencies (Cardinal Rule)
88
 
9
-- **Context:** The engine must run identically inside PostgreSQL (pgrx) and in
10
-  the browser/Node (wasm-bindgen). If target glue leaks into the core, the two
11
-  builds drift and "same core, same result" stops being true.
12
-- **Decision:** `feel-core` depends only on portable crates (today: `lalrpop`,
13
-  `lalrpop-util`). Anything pgrx- or wasm-bindgen-specific lives exclusively in
14
-  the wrapper crates `feel-pg` and `feel-wasm`.
15
-- **Consequence:** The core is reusable and testable on the host toolchain. We
16
-  enforce this with `cargo tree -p feel-core` (must show no `pgrx` /
17
-  `wasm-bindgen`). Boundary concerns (JSON mapping) are pushed to the wrappers.
9
+- **Context:** The engine must run inside PostgreSQL (pgrx), the browser/Node
10
+  (wasm-bindgen) and Python (pyo3) — and, planned, Lua (mlua) — from one core. Two
11
+  *distinct* invariants make "one core" mean something, and conflating them has
12
+  caused confusion (ADR-16 describes itself as a "relaxation of the cardinal rule"),
13
+  so name them apart:
14
+  - **I1 — Dependency purity (inviolable).** `feel-core` depends only on portable
15
+    crates (today: `lalrpop`/`lalrpop-util`, `logos`, `unicode-ident`, `jiff`, and
16
+    the optional `regex`); no *target* crate (`pgrx`/`wasm-bindgen`/`pyo3`/`mlua`)
17
+    ever enters its tree. Never relaxed.
18
+  - **I2 — Result determinism (relaxable, but only loudly).** The same expression
19
+    yields the same FEEL *value* on every target. A strong default, not an
20
+    absolute: ADR-16 (host regex dialect) and per-host temporal *representation*
21
+    (RD-2/RD-5) consciously relax it — always feature-flagged and documented, never
22
+    silently. The boundary *representation* of a value (jsonb vs native vs ISO) is a
23
+    wrapper concern (ADR-4), not part of I2.
24
+- **Decision:** Keep I1 absolute and I2 the default. Anything target-specific —
25
+  including the JSON/native boundary mapping — lives exclusively in the wrapper
26
+  crates (`feel-pg`, `feel-wasm`, `feel-py`, and the planned `feel-lua`).
27
+- **Consequence:** The core is reusable and testable on the host toolchain. I1 is
28
+  enforced mechanically with `cargo tree -p feel-core` (must show no
29
+  `pgrx`/`wasm-bindgen`/`pyo3`/`mlua`). Each I2 relaxation is recorded as an ADR or
30
+  RD, so a reader sees exactly where — and why — two targets may differ.
1831
 
1932
 ## ADR-2: Numbers are `f64` for now (deviation from spec `decimal128`)
2033
 
@@ -60,6 +73,16 @@
6073
   `evaluate(expr, context_json) -> String` (JSON). Integral numbers are emitted
6174
   as JSON integers so `1 + 1` yields `2`, not `2.0`. `feel-core` stays free of
6275
   any serialization dependency in its non-dev tree.
76
+- **Status:** The *literal* "JSON at the boundary" framing is superseded. It held
77
+  when feel-wasm exchanged JSON strings; the boundary has since become
78
+  *language-neutral structured values* whose concrete representation is per-wrapper —
79
+  `jsonb` (feel-pg) versus **native host values mapped lazily** through the
80
+  `ForeignObject` seam (feel-wasm/feel-py, and the planned feel-lua), temporal values
81
+  as native types or ISO-8601. See ADR-12 (Context), ADR-18 (temporal), ADR-20
82
+  (feel-py native mapping) and **ADR-21** (lazy host values). The durable part holds:
83
+  the mapping lives in the wrappers, never in core (ADR-1/I1), and integral numbers
84
+  stay integers (`1 + 1` → `2`). The per-target representation differences are the
85
+  I2-representation kind (ADR-1), not value divergence.
6386
 
6487
 ## ADR-5: Temporal mapping convention (not exercised in this slice)
6588
 
@@ -129,6 +152,11 @@
129152
 - **Consequence:** This is a visible behaviour change at the wrappers —
130153
   `feel_eval('1 + true')` now returns JSON `null` instead of raising an ERROR.
131154
   It is required for the three-valued TCK cases to pass and matches the spec.
155
+- **Status:** Refined by **ADR-14** — the error sources named here (type mismatch,
156
+  division by zero, non-finite arithmetic, non-boolean logic operands) now produce an
157
+  *error-null* (`Value::Error`) rather than a plain `Value::Null`, so provenance is
158
+  tracked and the strict boundary can surface them. The three-valued *result* is
159
+  unchanged (error-null behaves identically to null inside core).
132160
 
133161
 ## ADR-10: `Value` extended with String and List (map type superseded by ADR-12)
134162
 
@@ -311,9 +339,13 @@
311339
   tables, ~0.6 MB of code plus `.rodata`) dominated the WASM bundle. It was pulled
312340
   by two consumers: lalrpop's built-in lexer and these three builtins. Removing
313341
   the lexer's copy (the logos addendum to ADR-3) is not enough — the builtins
314
-  still pull the whole stack. Meanwhile each host already ships a capable regex
315
-  engine (the browser/Node `RegExp`; PostgreSQL's POSIX ARE), and FEEL/XPath regex
316
-  is its own dialect that no single embedded engine reproduces exactly anyway.
342
+  still pull the whole stack. Meanwhile *most* hosts already ship a capable regex
343
+  engine (the browser/Node `RegExp`; Python's `re`; PostgreSQL's POSIX ARE), and
344
+  FEEL/XPath regex is its own dialect that no single embedded engine reproduces
345
+  exactly anyway. (Where a host has *no* regex engine — Lua offers only the weaker
346
+  Lua *patterns*, not regex — the seam degrades gracefully: keep the bundled
347
+  `RustRegex`, as feel-pg does (RD-1), rather than force a lossy host dialect. The
348
+  provider is a per-target *choice*, not an obligation.)
317349
 - **Decision:** Abstract the three regex builtins behind a `FeelRegex` trait
318350
   (`is_match`/`replace`/`split`, each returning `None` → FEEL null for a
319351
   dialect/pattern error) and thread it through evaluation via an `Evaluator`
@@ -574,6 +606,89 @@
574606
   pytest cases (a getter fires on access, an untouched sibling property does **not**,
575607
   identity pass-through, cyclic finite path), and feel-wasm smoke cases (`Reflect.get`
576608
   getter, nested navigation, pass-through identity, cyclic termination).
609
+- **Thread-safety & lifetime (deliberate, and Lua-relevant):** `ForeignObject: Debug`
610
+  carries **no `Send`/`Sync` bound**, so `Value` and `Context` became `!Send + !Sync`
611
+  the moment a `Foreign` can appear. This is intentional — host handles are themselves
612
+  `!Send` (a `JsValue`; an mlua `Table`) — and costs the current hosts nothing, since
613
+  each evaluates on a single thread (the pgrx backend, the WASM thread, under the
614
+  Python GIL). The price: a `Value`/`Context` carrying a `Foreign` cannot cross
615
+  threads; a cross-thread embedder must first materialise a `Foreign`-free `Value`
616
+  (force the subtree) or take the eager-snapshot route (RD-6, "if flipped back"). The
617
+  trait object is `Arc<dyn ForeignObject + 'static>`, so a wrapper's stored handle must
618
+  be owned/`'static` — `Py<PyAny>`, `JsValue`, and mlua ≥ 0.10's lifetime-free `Table`
619
+  all qualify (an older, lifetime-parameterised mlua would not). This is what makes the
620
+  planned feel-lua (ADR-22) a clean fit rather than a fight with the borrow checker.
621
+
622
+## ADR-22 (planned): Lua bindings (`feel-lua`, mlua)
623
+
624
+- **Context:** feel-core already powers three wrappers (feel-pg, feel-wasm, feel-py).
625
+  Lua is a common embedded-scripting and rules host (game logic, Redis, nginx/
626
+  OpenResty, Neovim, application plugins), so a fifth target is a natural next step.
627
+  This entry records the decision and its constraints **before** the crate is built —
628
+  in the spirit of ADR-5 — so the next increment starts from a decision, not a blank
629
+  page. *Not yet built.*
630
+- **Decision (planned):** a new `crates/feel-lua`, a wrapper over the same core
631
+  (ADR-1/I1 holds — `mlua` lives only here), built with **mlua ≥ 0.10**. The 0.10 line
632
+  dropped the `'lua` lifetime parameter, so `Table`/`Value`/`Function` are owned and
633
+  `'static` and fit the `Arc<dyn ForeignObject + 'static>` seam (ADR-21) directly; an
634
+  older lifetime-parameterised mlua would not. Like feel-py (PyO3) and feel-pg (pgrx),
635
+  feel-lua needs a Lua *link context*, so it goes in the workspace `members` but
636
+  **not** `default-members` (a bare `cargo build` keeps building only the portable
637
+  members). The three boundary sub-decisions are recorded ahead as **RD-7** (regex),
638
+  **RD-8** (temporal) and **RD-9** (context mapping); the seven reusable seams are the
639
+  "Adding a wrapper" contract below.
640
+- **Hazard to plan for:** Lua signals errors by `longjmp` (like PostgreSQL — the RD-1
641
+  hazard), but mlua already wraps every C-API call and surfaces them as
642
+  `Result<_, mlua::Error>`. So `LuaForeign::get`/`force` map an `Err` (a raised
643
+  `__index` metamethod, a bad access) to a value-null — the same defensive pattern
644
+  feel-py uses around `getattr` (ADR-21). The longjmp never unwinds through Rust
645
+  frames; mlua catches it at the boundary.
646
+- **Consequence (anticipated):** a fifth target on the same core. `Value` stays
647
+  `!Send` (ADR-21), which *matches* mlua's non-`Send` values rather than fighting them.
648
+  I2 (ADR-1) relaxes here exactly as it does elsewhere — no Lua regex (RD-7), no native
649
+  Lua temporal (RD-8) — both loud and documented, neither a surprise.
650
+
651
+## Adding a wrapper — the host-binding contract
652
+
653
+The four wrappers (feel-pg, feel-wasm, feel-py, planned feel-lua) implement the same
654
+seven seams against feel-core. Writing them down once turns "add a target" into "fill a
655
+template" rather than re-deriving the boundary (as feel-py did, landing RD-4/5/6). Each
656
+seam links the ADR that defines it and the concrete core entry point.
657
+
658
+1. **Parse** — `feel_core::compile(expr) -> CompiledExpr`. Parse once, evaluate many
659
+   (feel-pg caches per call-site via pgrx `fn_extra`; the others expose `compile`).
660
+2. **Evaluate** — `CompiledExpr::evaluate_with_env(&ctx, &EvalEnv)`: the *single*
661
+   general entry the wrappers call (ADR-16/ADR-18; the regex-only `evaluate_with` was
662
+   retired). Build the `Context` with `Context::insert`.
663
+3. **Input mapping (lazy)** — scalars and temporals convert eagerly; an object/dict/
664
+   table becomes `Value::Foreign` wrapping a host-specific `ForeignObject` (`get` = the
665
+   FEEL dot, by name; `force` = materialise one level; `as_any` = recover the handle).
666
+   Catch host errors inside `get`/`force` → value-null (ADR-21).
667
+4. **Output mapping** — `Value` → host value; a `Value::Foreign` that reaches the result
668
+   is handed back **by identity** via `as_any` downcast (no re-traversal); temporal
669
+   values map to native host types or ISO-8601 (ADR-18); error-null/value-null per the
670
+   strict/lenient policy.
671
+5. **Regex provider** — implement `FeelRegex` over the host engine, *or* reuse the
672
+   bundled `RustRegex` when the host has none (ADR-16; only `matches`/`replace`/`split`
673
+   consult it).
674
+6. **Clock** — put a fixed `jiff::Zoned` instant in the `EvalEnv` so `now()`/`today()`
675
+   are stable for the whole evaluation (ADR-18; e.g. feel-pg's transaction start).
676
+7. **Strict vs lenient** — after eval, `value.contains_error()` decides: raise/throw
677
+   (strict) or `into_lenient()` → null (lenient default) (ADR-14).
678
+
679
+Per-wrapper choices at a glance (the detail, with revisit triggers, is in RD-1…9):
680
+
681
+| Seam | feel-pg | feel-wasm | feel-py | **feel-lua (planned)** |
682
+| --- | --- | --- | --- | --- |
683
+| Input mapping | eager `jsonb` | lazy `JsForeign` | lazy `PyForeign` | lazy `LuaForeign` (RD-9) |
684
+| Regex dialect | `RustRegex` (RD-1) | `JsRegex` (ADR-16) | `PyRegex`/`re` (RD-4) | `RustRegex` (RD-7) |
685
+| Temporal repr | ISO→native cast (RD-2) | JS `Date` / ISO (ADR-18) | `datetime`/`dateutil` (RD-5) | ISO-8601 string (RD-8) |
686
+| Clock | transaction start | `Date.now()` | system (`jiff::now()`) | system (`jiff::now()`) |
687
+| Strict surface | raise `ERROR` | throw | raise `FeelError` | Lua error |
688
+| Parse cache | `fn_extra` (auto) | `compile()` | `compile()` | `compile()` |
689
+
690
+(The matrix is a summary; RD-1…6 keep the full "weighed / decision / revisit trigger /
691
+if flipped" rationale a grid can't carry.)
577692
 
578693
 ## Revisable design decisions
579694
 
@@ -720,6 +835,56 @@
720835
   (e.g. an `eager=`/`force=` parameter) while keeping the lazy default — the seam
721836
   (`ForeignObject` + `Value::forced`) already supports forcing a whole subtree.
722837
 
838
+### RD-7: feel-lua keeps the Rust regex dialect (no Lua-pattern provider)
839
+
840
+- **Weighed:** ADR-16 makes the three regex builtins host-pluggable. Unlike the
841
+  browser (`RegExp`), Python (`re`) and Postgres (POSIX ARE), **Lua has no regex
842
+  engine** — only Lua *patterns*, which lack alternation, full quantifiers and general
843
+  grouping, so they cannot express FEEL/XPath regex. A faithful `LuaRegex` is therefore
844
+  off the table; the realistic options are (a) keep the bundled `RustRegex` (parity with
845
+  feel-core/TCK, like feel-pg RD-1) or (b) bind a C regex library (`lrexlib`/PCRE) — real
846
+  FFI weight for a marginal gain.
847
+- **Decision (planned):** feel-lua keeps the default `RustRegex` provider — same dialect
848
+  as feel-core and the TCK fixtures (the validated reference), and no native dependency.
849
+  The `evaluate_with_env` seam leaves the door open.
850
+- **Revisit trigger:** a concrete need for FEEL regex in Lua to match a host PCRE binding
851
+  users already author against.
852
+- **If flipped:** implement `struct LuaRegex` over `lrexlib`/PCRE as a
853
+  `feel_core::FeelRegex`, mapping its errors to `None` → FEEL null, and pass it via
854
+  `evaluate_with_env`; document PCRE as a per-target divergence under ADR-16.
855
+
856
+### RD-8: feel-lua temporal mapping is ISO-8601 strings
857
+
858
+- **Weighed:** ADR-18's boundary is canonical ISO-8601. Lua has **no native date/time
859
+  type** — only numbers, strings and tables (`os.time`/`os.date` work in epoch seconds or
860
+  `{year=, month=, …}` tables). Options for the five FEEL temporal types: ISO-8601 strings
861
+  (as feel-wasm leaves durations), `os.date`-style tables, or userdata from a Lua datetime
862
+  library.
863
+- **Decision (planned):** map every temporal type to/from a **canonical ISO-8601 string** —
864
+  the portable boundary ADR-18 already produces, with zero extra dependency and no lossy
865
+  conversion. A convenience `os.date`-style table form (`{year=, month=, day=, …}`) on input
866
+  is a possible later addition, not the default.
867
+- **Revisit trigger:** users want first-class Lua date objects (integration with a specific
868
+  Lua datetime lib) rather than ISO strings.
869
+- **If flipped:** add a table/userdata mapping in the wrapper boundary (`to_iso`/
870
+  `temporal_from_iso` already bridge the value side); keep ISO as the fallback.
871
+
872
+### RD-9: feel-lua context mapping is lazy (`LuaForeign`)
873
+
874
+- **Weighed:** ADR-21 made host context mapping lazy via `ForeignObject`, so an ORM row or
875
+  deep table resolves one dot at a time. A Lua table can carry an `__index` metamethod (a
876
+  computed/lazy field) exactly like a Python `@property`, so the lazy seam fits; an eager
877
+  alternative would snapshot and miss metamethod semantics.
878
+- **Decision (planned):** wrap an `mlua::Table` (or userdata) in a `LuaForeign` implementing
879
+  `ForeignObject`: `get` via `Table::get` (which fires `__index`, the on-demand load), an
880
+  `Err` → value-null; `force` enumerates the table's own pairs one level; `as_any` recovers
881
+  the handle for identity pass-through. Scalars and temporals (RD-8) stay eager. Mirrors
882
+  feel-py's `PyForeign` and feel-wasm's `JsForeign`.
883
+- **Revisit trigger:** a need to forbid metamethod side effects entirely during evaluation
884
+  (a hard "no `__index` runs" guarantee).
885
+- **If flipped:** offer an opt-in eager snapshot (force the whole subtree at the boundary)
886
+  while keeping lazy the default — the same escape hatch RD-6 describes.
887
+
723888
 ## Roadmap: deferred scope (recorded, not yet built)
724889
 
725890
 These were considered and deliberately deferred to keep the slice thin. Listed so

modified README.md +8 −5

@@ -44,14 +44,17 @@
4444
 in names, and user-defined functions. See [DECISIONS.md](DECISIONS.md) for the
4545
 architecture decisions, the deferred-scope roadmap, and accepted deviations
4646
 (notably: numbers are `f64`, not spec `decimal128`; type errors evaluate to
47
-`null`; temporal values outside jiff's range are skipped).
47
+`null`; temporal values outside jiff's range are skipped) — plus the
48
+"Adding a wrapper — the host-binding contract" section for porting the engine to a
49
+new target.
4850
 
4951
 ## Architecture invariant (Cardinal Rule)
5052
 
51
-`feel-core` must never depend on pgrx, wasm-bindgen or pyo3. Verify:
52
-
53
-```sh
54
-cargo tree -p feel-core --edges normal,build | grep -E 'pgrx|wasm-bindgen|pyo3' && echo VIOLATION || echo OK
53
+`feel-core` must never depend on pgrx, wasm-bindgen or pyo3 (nor, once the planned
54
+Lua wrapper lands, mlua). Verify:
55
+
56
+```sh
57
+cargo tree -p feel-core --edges normal,build | grep -E 'pgrx|wasm-bindgen|pyo3|mlua' && echo VIOLATION || echo OK
5558
 ```
5659
 
5760
 ## Toolchain

modified crates/feel-core/src/lib.rs +13 −35

@@ -99,30 +99,20 @@
9999
     /// default regex provider (`RustRegex` with the `rust-regex` feature on,
100100
     /// otherwise a no-op provider whose regex builtins yield an error-null) and
101101
     /// the wall-clock instant for `now()`/`today()`.
102
+    ///
103
+    /// Use [`CompiledExpr::evaluate_with_env`] to control the regex provider or
104
+    /// the `now()`/`today()` instant (the wrappers inject their host's there).
102105
     pub fn evaluate(&self, context: &Context) -> Result<Value, FeelError> {
103
-        self.evaluate_with(context, &regex_provider::DEFAULT)
104
-    }
105
-
106
-    /// Evaluate against a context using a caller-supplied [`FeelRegex`] provider,
107
-    /// with the wall-clock instant for `now()`/`today()`.
108
-    ///
109
-    /// This is the seam for host-environment regex dialects (ADR-16): only the
110
-    /// `matches`/`replace`/`split` builtins consult `regex`; every other result
111
-    /// is identical regardless of provider. To also control the evaluation
112
-    /// instant (e.g. a transaction timestamp, or a fixed instant in tests) use
113
-    /// [`CompiledExpr::evaluate_with_env`].
114
-    pub fn evaluate_with(
115
-        &self,
116
-        context: &Context,
117
-        regex: &dyn FeelRegex,
118
-    ) -> Result<Value, FeelError> {
119
-        self.evaluate_with_env(context, &EvalEnv::new(regex, default_now()))
120
-    }
121
-
122
-    /// Evaluate against a context using a fully caller-supplied [`EvalEnv`]
123
-    /// (regex provider + the instant `now()`/`today()` read; ADR-18). The
124
-    /// wrappers inject their host's clock here (e.g. feel-pg's transaction start),
125
-    /// which also makes `now()`/`today()` deterministic in tests.
106
+        self.evaluate_with_env(context, &EvalEnv::new(&regex_provider::DEFAULT, default_now()))
107
+    }
108
+
109
+    /// Evaluate against a context using a fully caller-supplied [`EvalEnv`] —
110
+    /// the single general entry point the wrappers use. The env carries both
111
+    /// seams: the host regex provider (ADR-16: only `matches`/`replace`/`split`
112
+    /// consult it; every other result is provider-independent) and the instant
113
+    /// `now()`/`today()` read (ADR-18). The wrappers inject their host's clock
114
+    /// here (e.g. feel-pg's transaction start), which also makes `now()`/`today()`
115
+    /// deterministic in tests.
126116
     pub fn evaluate_with_env(
127117
         &self,
128118
         context: &Context,
@@ -180,18 +170,6 @@
180170
 /// ```
181171
 pub fn evaluate(expr: &str, context: &Context) -> Result<Value, FeelError> {
182172
     compile(expr)?.evaluate(context)
183
-}
184
-
185
-/// Parse and evaluate a FEEL expression with a caller-supplied [`FeelRegex`]
186
-/// provider. Convenience for `compile(expr)?.evaluate_with(context, regex)`;
187
-/// prefer [`compile`] + [`CompiledExpr::evaluate_with`] when evaluating the same
188
-/// expression more than once.
189
-pub fn evaluate_with(
190
-    expr: &str,
191
-    context: &Context,
192
-    regex: &dyn FeelRegex,
193
-) -> Result<Value, FeelError> {
194
-    compile(expr)?.evaluate_with(context, regex)
195173
 }
196174
 
197175
 #[cfg(test)]

modified crates/feel-core/src/regex_provider.rs +2 −2

@@ -54,7 +54,7 @@
5454
 
5555
 /// The provider used by the no-argument `evaluate` / `CompiledExpr::evaluate`
5656
 /// path: `RustRegex` when the `rust-regex` feature is on (default), else
57
-/// `NoRegex`. Callers that want a different dialect use `evaluate_with`.
57
+/// `NoRegex`. Callers that want a different dialect use `evaluate_with_env`.
5858
 #[cfg(feature = "rust-regex")]
5959
 pub(crate) const DEFAULT: RustRegex = RustRegex;
6060
 #[cfg(not(feature = "rust-regex"))]
@@ -65,7 +65,7 @@
6565
 // --------------------------------------------------------------------------- //
6666
 
6767
 /// The provider used when the crate is built **without** `rust-regex` and no
68
-/// host engine is supplied via `evaluate_with`. The three regex builtins then
68
+/// host engine is supplied via `evaluate_with_env`. The three regex builtins then
6969
 /// evaluate to an *error-null* (there is no engine to consult — see
7070
 /// [`FeelRegex::available`]). Real targets always inject a provider (`feel-wasm`)
7171
 /// or keep `rust-regex` on (`feel-pg`, default core), so this is only reached by a

modified crates/feel-pg/src/lib.rs +1 −1

@@ -13,7 +13,7 @@
1313
 //! `matches`/`replace`/`split` use the Rust regex dialect (ADR-15/ADR-16). A
1414
 //! future `PgRegex` provider could route them through Postgres' own POSIX ARE
1515
 //! engine (e.g. `DirectFunctionCall` to `textregexreplace` /
16
-//! `regexp_split_to_array`) and be passed via `CompiledExpr::evaluate_with`, so
16
+//! `regexp_split_to_array`) and be passed via `CompiledExpr::evaluate_with_env`, so
1717
 //! the *host* dialect applies server-side too — deferred, not done here.
1818
 //!
1919
 //! Temporal values (ADR-18) cross the boundary as canonical ISO-8601 jsonb