Commit Graph
503 Commits
Author SHA1 Message Date
Effect Bot 1dcc764db1 Join typed isIn candidates in halves, keep fractional candidates in a list of their own on SQL and compare UInt64 candidates unsigned 2026-11-16 13:56:57 +00:00
Effect Bot 643c22ba2c Compare isIn candidates with decimal values instead of their unscaled units and compare typed candidates with eq 2026-11-16 13:35:05 +00:00
Effect Bot 7dde5f32a3 Keep integers exact next to negative-scale decimals, give decimal literals a valid checked type and convert floats at scales past 308 2026-11-16 13:25:22 +00:00
Effect Bot dbf60e63c0 Decide decimal scales far apart from the 64-bit storage range and reject decimal widths, cast targets and SQL scales that can't be held 2026-11-16 13:02:05 +00:00
Effect Bot 035eb7bcff Type duration sums as durations and reject the means and sums the engines disagree on 2026-11-16 09:18:57 +00:00
Effect Bot e1559942d6 Test a checked field with the schema's own guard, so null and oneOf unions are checked as Schema.is checks them 2026-11-16 09:18:16 +00:00
Effect Bot 0ad0fb972d Keep the checks of a union's members when its null member is suspended 2026-11-16 09:18:16 +00:00
Effect Bot b8d296127e Run a table declared by an Arrow schema on PostgreSQL 2026-11-16 09:18:16 +00:00
Effect Bot 194d0fe30f Cover the columnar path of temporal and decimal columns 2026-11-16 09:18:16 +00:00
Effect Bot a415abf891 Map DataFrame API contracts to runtime and type coverage 2026-11-16 09:18:15 +00:00
Effect Bot 88fa4baa51 Trim setup and share error helpers in the PGlite DataFrame tests 2026-11-16 09:18:15 +00:00
Effect Bot 158f530359 Share one SQL source among names PostgreSQL keeps as one
Declarations of one table whose column names differ only past their
first 63 bytes put that one column twice in the table's MATERIALIZED
source, so PostgreSQL rejected the query as ambiguous although each
declaration ran alone. The source now names its columns, and is keyed
by its table's name, as PostgreSQL keeps them: every such declaration
reads the one column or relation, once, each with its own checks.
2026-11-16 09:18:15 +00:00
Effect Bot c43ddd8c06 Reject columns PostgreSQL can't tell apart in SQL plans
PostgreSQL keeps the whole characters within a name's first 63 bytes, so
two columns of one relation that share them are one column to it, and the
query failed with an ambiguous reference. Fail at compile time instead,
naming both columns.
2026-11-16 09:18:15 +00:00
Effect Bot 5d3535ea74 Keep the names the SQL compiler invents distinct after truncation
The prefix of invented names grew with the plan's names, so a 63-byte
table name made every helper name truncate to one identifier, and a
57-byte one dropped the suffixes of the tables' sources. Number the
prefix instead: __, then __1_, __2_, ... A name starts with at most one
of those, so invented names stay short and PostgreSQL keeps them whole.
2026-11-16 09:18:15 +00:00
Effect Bot f79b5821db Fit integer literals of when and coalesce by their plan-time range
The type of an operand built from integer literals was chosen from the
values of the current batch, so results depended on batch boundaries
and slice pushdown. A when or coalesce of literals now carries the
range of its literals; a scalar fits by its value; other operands
computed from literals count as Int32.
2026-11-16 09:18:15 +00:00
Effect Bot 93f09f6660 Document that SQL table names are single quoted identifiers 2026-11-16 09:18:15 +00:00
Effect Bot 3f0fea0209 Qualify the columns the SQL column type checks read by their table 2026-11-16 09:18:15 +00:00
Effect Bot be557ebd22 Reserve table names from the names the SQL compiler invents 2026-11-16 09:18:15 +00:00
Effect Bot 216666cd16 Read SQL table columns as their declared types
Accepted source columns kept their PostgreSQL types inside the query, so
expressions saw a different type than the declared one: lower() failed on
enums, enum comparisons parsed literals as labels and enums sorted by
declaration, char(n) compared without padding, smallint sums overflowed
where Int32 doesn't, and real arithmetic rounded to Float32 where Float64
doesn't. Read every declared column as the PostgreSQL type of its
declared type (strings, enums and char(n) as text, as PostgreSQL converts
them) where the result reads the source, so every expression sees it.
2026-11-16 09:18:15 +00:00
Effect Bot ab0d642854 Check SQL table values against their whole declared type
The SQL engine checked only temporal units and decimal digits, so an
INTEGER 256 declared Int8, a DOUBLE 0.1 declared Float32 or a NUMERIC 1
declared decimal(38, 20) passed, silently rounded or failed to decode,
while memory rejects them. Give every column type in tableTypes the
conditions its values must meet for the declared type to hold them
exactly (integer ranges, Float32 round trips, decimal precision, scale and
64-bit storage, finite dates, timestamp range and whole units, intervals
without months), and derive both the row checks and the null-guarded
reads from them, with memory's messages. The checks read the source, so
columns the query doesn't read are checked too.
2026-11-16 09:18:15 +00:00
Effect Bot 190650d897 Read each SQL table once, through a materialized source
The row checks and the result read a table through a NOT MATERIALIZED
source unless it called volatile functions, so PostgreSQL could scan it
twice and a view that samples rows (TABLESAMPLE) or calls a function that
differs per scan could pass the checks on rows the result doesn't return.
Read every table name once, through one MATERIALIZED source that
PostgreSQL computes once per statement, for the checks and the result of
every node that reads it; timestamps are read as UTC by the nodes, since
the source is shared.
2026-11-16 09:18:15 +00:00
Effect Bot d20786793f Check a struct schema's checks on whole rows
DataFrame.validate and table reads checked the values of fields a schema
constrains, but ignored the struct's own checks (Schema.Struct(...).check),
so rows the schema rejects were accepted. conform now runs them on the rows
when the struct has any. A SQL engine checks tables column by column, so a
query over a table whose schema has them fails when it is compiled.
2026-11-16 09:18:15 +00:00
Effect Bot 6c55c708ad Read declared SQL table columns as the types memory conforms them to
The SQL engine read every declared Timestamp/Duration table column as
microseconds and rejected Decimal columns, while the memory engine
conforms tables to the declared unit, precision and scale. Read table
columns as Schema_.arrowType gives them, accept numeric for decimals, and
fail in the statement, with memory's message, on values the declared type
can't hold exactly (fractions of the unit, nanoseconds beyond 64 bits,
decimals that need rounding or more digits). Inexact values read as null so
that reading them doesn't fail before the checks do.
2026-11-16 09:18:15 +00:00
Effect Bot 0980adf3b4 Check SQL tables in the statement that reads them, as memory checks them
Row checks and the result now share one statement and snapshot; volatile views are computed once for both. Column types are checked against what memory accepts, Null columns must hold only nulls, timestamps must be in DateTime range and read as UTC whatever the session time zone, and intervals must not have months.
2026-11-16 09:18:15 +00:00
Effect Bot 757d2c036b Bring SQL temporal operands of mixed units to the coarser unit first 2026-11-16 09:18:15 +00:00
Effect Bot 4c15c4e6bd Compute SQL aggregate arguments per group before aggregating 2026-11-16 09:18:15 +00:00
Effect Bot 8ee9e43e22 Keep the first row for SQL unique on no columns 2026-11-16 09:18:15 +00:00
Effect Bot 26af0e3dca Use boolean aggregates for SQL boolean minimum and maximum 2026-11-16 09:18:15 +00:00
Effect Bot b02df05eb9 Lower SQL temporal casts through their units 2026-11-16 09:18:15 +00:00
Effect Bot 44e0e2c09e Check SQL tables against their declared columns and schema 2026-11-16 09:18:15 +00:00
Effect Bot f3ebf16642 Compile DataFrame plans for PostgreSQL only 2026-11-16 09:18:15 +00:00
Effect Bot 465db761a3 Type SQL engine results from the in-memory engine
Compile runs the plan through the in-memory engine on zero-row inputs
(values emptied, tables from their declared columns) and uses the frames
for every type decision. Compiled now carries the result schema; the
final query renders each column as text (temporal values as integers in
their unit) and the engine decodes rows against that schema.

Also fixes round (float, integer and decimal semantics of the engine),
boolean sums, window functions in filters, temporal and decimal values
at full precision, OVER () for empty partition lists, countDistinct of
empty input, helper names that clash with columns, sqrt of negative
numbers, and keeps the driver's message in errors.
2026-11-16 09:18:15 +00:00
Sebastian Lorenz b145ed1ea4 Add effect/dataframe
Typed columnar data frames and lazy queries on top of effect/arrow, with in-memory, streaming and SQL engines. Split out of #10641.
2026-11-16 09:18:15 +00:00
Ruslana AvramovaandEffect Bot 7ed08807b6 Make SqlModel repository updates work on SQL Server (#10563)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
2026-11-12 10:57:52 +13:00
effect-bot 289a53f7b1 Version Packages (#10531) 2026-11-11 03:56:37 +00:00
effect-bot 7865dbbb7b Version Packages (#10295) 2026-11-10 02:53:30 +00:00
Ibrahim ElkamaliandEffect Bot ded4ccfb04 Fix SqlClient.withoutTransforms keeping query name transforms (#10454)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
2026-11-10 13:45:46 +13:00
effect-bot 68e628d43c fix(sql): skip savepoint release after an ancestor ends during rollback (#10508) 2026-11-10 13:06:26 +13:00
Jon PowersandEffect Bot 47563e9672 Fail driver-level transaction lookups from a fiber that outlives its transaction (#10434)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
2026-11-10 13:05:58 +13:00
effect-bot e6a1d6f567 Fix sql-pg span metadata for connection URLs (#10500) 2026-11-10 12:13:37 +13:00
Jon PowersandEffect Bot a26ad6397c Fail statements from a fiber that outlives its transaction (#10433)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
2026-11-10 12:06:05 +13:00
Ibrahim ElkamaliandEffect Bot 4c462bde0e Fix sql-mssql binding returning parameters before insert and updateValues row values (#10452)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
2026-11-10 11:56:29 +13:00
effect-bot 076b2c07ae Fail only the query when an unregistered PostgreSQL value cannot be decoded (#10422) 2026-11-10 11:44:28 +13:00
effect-bot 06461da37a Fix PostgreSQL transport retirement after scope release (#10473) 2026-11-10 11:36:51 +13:00
Tim ba272c5196 Update repository dependencies (#10466) 2026-11-09 10:29:20 +13:00
effect-botandTim 13c0e778ce fix(sql): keep driver services in requirements when SqlClient is provided (#10387)
Co-authored-by: Tim <hello@timsmart.co>
2026-11-05 00:10:16 +00:00
effect-bot da52437f6e Add retention-based cleanup of completed cluster requests (#10267) 2026-11-04 15:52:02 +13:00
Ori ErelandEffect Bot 075892d51c Keep typed SQL errors when the server ends a PgClient session in a transaction (#10291)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
2026-11-03 12:43:58 +13:00
effect-bot 506eef143b Version Packages (#10212) 2026-11-02 16:59:53 +13:00
Tim b0a1ceebcd Update repository dependencies (#10257) 2026-11-02 16:21:02 +13:00