@minnowdb/core 0.7.10 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine/client.d.ts +3 -0
- package/dist/engine/client.js +8 -0
- package/dist/engine/database.js +189 -35
- package/dist/engine/errors.d.ts +2 -2
- package/dist/engine/errors.js +1 -1
- package/dist/engine/live-aggregate.d.ts +12 -0
- package/dist/engine/live-aggregate.js +226 -0
- package/dist/engine/live-patch.d.ts +21 -0
- package/dist/engine/live-patch.js +31 -0
- package/dist/engine/live.d.ts +12 -0
- package/dist/engine/live.js +52 -49
- package/dist/engine/optimizer.js +11 -6
- package/dist/engine/query-cache.js +2 -13
- package/dist/engine/query-generations.d.ts +8 -0
- package/dist/engine/query-generations.js +61 -0
- package/dist/engine/query-identity.d.ts +3 -0
- package/dist/engine/query-identity.js +41 -0
- package/dist/engine/query.d.ts +6 -11
- package/dist/engine/query.js +294 -428
- package/dist/engine/sql-domains.d.ts +4 -0
- package/dist/engine/sql-domains.js +121 -0
- package/dist/engine/sql-semantics.js +7 -4
- package/dist/engine/typed-live.js +28 -20
- package/dist/engine/windows.d.ts +12 -0
- package/dist/engine/windows.js +386 -0
- package/dist/plan/model.d.ts +1 -1
- package/package.json +1 -1
- package/postgres-feature-profile.json +6 -1
- package/sql-feature-matrix.json +20 -27
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
{
|
|
143
143
|
"id": "type.exact-numeric",
|
|
144
144
|
"classification": "different",
|
|
145
|
-
"reason": "Minnow preserves exact decimals at the JavaScript boundary as strings, as PGlite's default decoder also does. A declared scale renders at exactly that scale as PostgreSQL does; a bare NUMERIC column, a derived arithmetic result, and a value cast or concatenated to text render canonically, without the trailing fractional zeros PostgreSQL preserves. Division and AVG select their result scale the way PostgreSQL does, so quotient digits agree
|
|
145
|
+
"reason": "Minnow preserves exact decimals at the JavaScript boundary as strings, as PGlite's default decoder also does. A declared scale renders at exactly that scale as PostgreSQL does; a bare NUMERIC column, a derived arithmetic result, and a value cast or concatenated to text render canonically, without the trailing fractional zeros PostgreSQL preserves. Division and AVG select their result scale the way PostgreSQL does, so quotient digits agree \u2014 including AVG over a column whose declared scale exceeds the selection. The canonical encoding does drop a stored value's display scale, so an explicit arithmetic quotient (such as SUM(v) / COUNT(v)) over a column declared with more than about twenty fractional digits can carry fewer digits than PostgreSQL, which floors the selection at the operand's display scale. An arithmetic or comparison expression mixing a float column with a constant Float64 cannot represent stays exact, where PostgreSQL casts the constant to float8 and rounds it before evaluating."
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
148
|
"id": "type.json-jsonb",
|
|
@@ -258,6 +258,11 @@
|
|
|
258
258
|
"id": "privileges.grant",
|
|
259
259
|
"classification": "inapplicable",
|
|
260
260
|
"reason": "An embedded database has no server roles, owners, or GRANT boundary."
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"id": "aggregate.array-agg",
|
|
264
|
+
"classification": "different",
|
|
265
|
+
"reason": "Minnow returns arrays as canonical JSON text at the JavaScript boundary; PostgreSQL clients return native arrays. ARRAY_AGG supports DISTINCT and ordering, but not FILTER or window use."
|
|
261
266
|
}
|
|
262
267
|
]
|
|
263
268
|
}
|
package/sql-feature-matrix.json
CHANGED
|
@@ -653,14 +653,13 @@
|
|
|
653
653
|
"id": "window.frame",
|
|
654
654
|
"status": "supported",
|
|
655
655
|
"example": "SELECT amount, SUM(amount) OVER (ORDER BY amount, joined ROWS BETWEEN 1 PRECEDING AND CURRENT ROW) AS windowed FROM rows",
|
|
656
|
-
"notes": "ROWS frames
|
|
656
|
+
"notes": "ROWS frames use row distances; RANGE frames use peers or numeric ordering-value distances; GROUPS frames use peer-group distances. Exclusions are supported."
|
|
657
657
|
},
|
|
658
658
|
{
|
|
659
659
|
"id": "window.frame-range-offset",
|
|
660
|
-
"status": "
|
|
660
|
+
"status": "supported",
|
|
661
661
|
"example": "SELECT amount, SUM(amount) OVER (ORDER BY amount RANGE BETWEEN 1 PRECEDING AND CURRENT ROW) AS windowed FROM rows",
|
|
662
|
-
"
|
|
663
|
-
"notes": "A numeric RANGE offset bounds the frame by ordering-value distance, which the engine does not implement. ROWS frames take numeric offsets; RANGE frames take UNBOUNDED and CURRENT ROW bounds only."
|
|
662
|
+
"notes": "Numeric RANGE offsets measure ordering-value distance and require one numeric ORDER BY expression. Temporal interval offsets are not supported."
|
|
664
663
|
},
|
|
665
664
|
{
|
|
666
665
|
"id": "window.distinct-aggregate",
|
|
@@ -671,10 +670,9 @@
|
|
|
671
670
|
},
|
|
672
671
|
{
|
|
673
672
|
"id": "window.outside-select",
|
|
674
|
-
"status": "
|
|
673
|
+
"status": "supported",
|
|
675
674
|
"example": "SELECT amount FROM rows ORDER BY ROW_NUMBER() OVER (ORDER BY amount)",
|
|
676
|
-
"
|
|
677
|
-
"notes": "PostgreSQL also evaluates window functions in ORDER BY; Minnow evaluates them only as select items. Alias the window in the select list and order by the alias."
|
|
675
|
+
"notes": "Window functions work in SELECT and ORDER BY. WHERE, GROUP BY, and HAVING cannot contain windows."
|
|
678
676
|
},
|
|
679
677
|
{
|
|
680
678
|
"id": "join.right",
|
|
@@ -843,7 +841,7 @@
|
|
|
843
841
|
"id": "expression.cast",
|
|
844
842
|
"status": "supported",
|
|
845
843
|
"example": "SELECT CAST(amount AS INTEGER) AS whole, CAST(amount AS TEXT) AS label FROM rows",
|
|
846
|
-
"notes": "
|
|
844
|
+
"notes": "Integer casts round exact NUMERIC ties away from zero and floating-point ties to even. Integer text accepts signed decimal digits. Postfix :: and CAST use the same rules."
|
|
847
845
|
},
|
|
848
846
|
{
|
|
849
847
|
"id": "identifier.quoted",
|
|
@@ -928,10 +926,9 @@
|
|
|
928
926
|
},
|
|
929
927
|
{
|
|
930
928
|
"id": "join.full-grouped",
|
|
931
|
-
"status": "
|
|
929
|
+
"status": "supported",
|
|
932
930
|
"example": "SELECT r.region AS region, COUNT(*) AS matched FROM rows r FULL JOIN dims d ON d.region = r.region GROUP BY r.region",
|
|
933
|
-
"
|
|
934
|
-
"notes": "FULL JOIN desugars into a union of two left joins, and grouping, DISTINCT, and window functions do not distribute over that union yet. Put the FULL JOIN in a derived table and group, deduplicate, or window in the outer block."
|
|
931
|
+
"notes": "The sole FULL JOIN composes with grouping, DISTINCT, wildcards, and window functions by applying these operations after both unmatched sides are included."
|
|
935
932
|
},
|
|
936
933
|
{
|
|
937
934
|
"id": "order-by.ordinal",
|
|
@@ -1114,10 +1111,9 @@
|
|
|
1114
1111
|
},
|
|
1115
1112
|
{
|
|
1116
1113
|
"id": "join.full-compound-on",
|
|
1117
|
-
"status": "
|
|
1118
|
-
"example": "SELECT r.region FROM rows r FULL JOIN
|
|
1119
|
-
"
|
|
1120
|
-
"notes": "FULL JOIN takes a single equality ON condition; move the extra condition into a derived source."
|
|
1114
|
+
"status": "supported",
|
|
1115
|
+
"example": "SELECT r.region FROM rows r FULL JOIN dims d ON d.region = r.region AND d.label <> ''",
|
|
1116
|
+
"notes": "A sole FULL JOIN accepts compound ON predicates and preserves unmatched rows from both sides."
|
|
1121
1117
|
},
|
|
1122
1118
|
{
|
|
1123
1119
|
"id": "datetime.current-date",
|
|
@@ -1552,10 +1548,9 @@
|
|
|
1552
1548
|
},
|
|
1553
1549
|
{
|
|
1554
1550
|
"id": "aggregate.array-agg",
|
|
1555
|
-
"status": "
|
|
1556
|
-
"example": "SELECT region, array_agg(amount) AS amounts FROM rows GROUP BY region",
|
|
1557
|
-
"
|
|
1558
|
-
"notes": "array_agg is not supported because arrays are not; json_agg (JSON_ARRAYAGG) collects a group into a JSON array instead."
|
|
1551
|
+
"status": "supported",
|
|
1552
|
+
"example": "SELECT region, array_agg(amount ORDER BY amount) AS amounts FROM rows GROUP BY region ORDER BY region",
|
|
1553
|
+
"notes": "ARRAY_AGG supports DISTINCT and aggregate-local ORDER BY, includes NULL elements, and returns NULL for empty input. Arrays cross the JavaScript boundary as canonical JSON text. FILTER and window use are not supported."
|
|
1559
1554
|
},
|
|
1560
1555
|
{
|
|
1561
1556
|
"id": "aggregate.ordered-set",
|
|
@@ -1568,14 +1563,13 @@
|
|
|
1568
1563
|
"id": "type.array",
|
|
1569
1564
|
"status": "supported",
|
|
1570
1565
|
"example": "SELECT ARRAY[1, 2] AS pair",
|
|
1571
|
-
"notes": "Constructors and array columns use canonical JSON text at the JavaScript boundary.
|
|
1566
|
+
"notes": "Constructors and array columns use canonical JSON text at the JavaScript boundary. One-based scalar subscripts and ARRAY_AGG are supported. Array operators such as concatenation and ANY/ALL remain unsupported."
|
|
1572
1567
|
},
|
|
1573
1568
|
{
|
|
1574
1569
|
"id": "type.array-subscript",
|
|
1575
|
-
"status": "
|
|
1570
|
+
"status": "supported",
|
|
1576
1571
|
"example": "SELECT (ARRAY[1, 2, 3])[1] AS first_element",
|
|
1577
|
-
"
|
|
1578
|
-
"notes": "PostgreSQL reads array elements with one-based subscripts and slices. Minnow arrays are opaque JSON text values; element access is refused at parse time."
|
|
1572
|
+
"notes": "One-based scalar subscripts return NULL for an out-of-range position. Slices and multidimensional access are not supported."
|
|
1579
1573
|
},
|
|
1580
1574
|
{
|
|
1581
1575
|
"id": "type.array-any",
|
|
@@ -1748,7 +1742,7 @@
|
|
|
1748
1742
|
"status": "unsupported",
|
|
1749
1743
|
"example": "SELECT INTERVAL '1 day' + INTERVAL '2 hours' AS total FROM rows",
|
|
1750
1744
|
"error": "Date arithmetic requires a date or datetime value",
|
|
1751
|
-
"notes": "Interval-valued arithmetic — interval + interval, timestamp - timestamp, date - date, date + integer,
|
|
1745
|
+
"notes": "Interval-valued arithmetic — interval + interval, timestamp - timestamp, date - date, date + integer, justify_days — is not supported. A date or datetime plus or minus an INTERVAL is; subtract two EXTRACT(EPOCH …) readings for a duration in seconds."
|
|
1752
1746
|
},
|
|
1753
1747
|
{
|
|
1754
1748
|
"id": "expression.date-minus-date",
|
|
@@ -1828,10 +1822,9 @@
|
|
|
1828
1822
|
},
|
|
1829
1823
|
{
|
|
1830
1824
|
"id": "function.unnest",
|
|
1831
|
-
"status": "
|
|
1825
|
+
"status": "supported",
|
|
1832
1826
|
"example": "SELECT x FROM unnest(ARRAY[3, 1, 2]) AS x",
|
|
1833
|
-
"
|
|
1834
|
-
"notes": "Set-returning functions (unnest, generate_series, regexp_split_to_table, jsonb_array_elements) are not supported as FROM sources; use a VALUES source, a recursive CTE for a series, or JSON_TABLE for a JSON array."
|
|
1827
|
+
"notes": "UNNEST over an ARRAY constructor produces typed rows and supports WITH ORDINALITY and output column aliases. Table-correlated array inputs and arbitrary array expressions are not supported."
|
|
1835
1828
|
},
|
|
1836
1829
|
{
|
|
1837
1830
|
"id": "function.generate-series",
|