@minnowdb/core 0.6.5 → 0.6.6
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/artifact-cache.d.ts +2 -1
- package/dist/engine/batch.d.ts +0 -1
- package/dist/engine/batch.js +1 -1
- package/dist/engine/buffered-writer.js +1 -12
- package/dist/engine/byte-estimates.d.ts +11 -0
- package/dist/engine/byte-estimates.js +25 -0
- package/dist/engine/database.js +58 -34
- package/dist/engine/fts.d.ts +0 -1
- package/dist/engine/fts.js +1 -1
- package/dist/engine/join-index.d.ts +0 -1
- package/dist/engine/optimizer.js +9 -2
- package/dist/engine/point-read.d.ts +1 -1
- package/dist/engine/point-read.js +3 -2
- package/dist/engine/query-cache.js +1 -12
- package/dist/engine/query.d.ts +20 -59
- package/dist/engine/query.js +280 -39
- package/dist/engine/result-wire.d.ts +2 -1
- package/dist/engine/schema.d.ts +18 -2
- package/dist/engine/schema.js +11 -2
- package/dist/engine/sort-keys.d.ts +2 -3
- package/dist/engine/sort-keys.js +1 -1
- package/dist/engine/sql-domains.d.ts +27 -2
- package/dist/engine/sql-domains.js +120 -6
- package/dist/engine/sql-json.d.ts +0 -2
- package/dist/engine/sql-json.js +1 -1
- package/dist/engine/sql-semantics.d.ts +2 -1
- package/dist/engine/vector.d.ts +7 -7
- package/dist/engine/vector.js +8 -4
- package/dist/engine/write-block-planner.d.ts +2 -1
- package/dist/plan/model.d.ts +15 -0
- package/dist/storage/opfs/leader.d.ts +0 -4
- package/dist/storage/opfs/leader.js +2 -2
- package/dist/storage/opfs/snapshot-ledger.d.ts +3 -2
- package/dist/storage/toolkit/index.d.ts +1 -1
- package/dist/storage/toolkit/record-core.d.ts +0 -1
- package/dist/storage/toolkit/record-core.js +0 -7
- package/dist/testing/opfs-shim.d.ts +2 -1
- package/dist/testing/simulator.js +3 -0
- package/dist/worker-protocol/index.d.ts +1 -1
- package/dist/worker-protocol/index.js +0 -1
- package/package.json +2 -1
- package/postgres-feature-profile.json +8 -3
- package/sql-feature-matrix.json +71 -11
package/sql-feature-matrix.json
CHANGED
|
@@ -676,7 +676,7 @@
|
|
|
676
676
|
"CREATE TABLE stats (region TEXT UNIQUE, total REAL)",
|
|
677
677
|
"INSERT INTO stats (region, total) VALUES ('east', 0), ('west', 0)"
|
|
678
678
|
],
|
|
679
|
-
"notes": "UPDATE and DELETE trigger bodies run against keyed tables, reading current state each firing.
|
|
679
|
+
"notes": "UPDATE and DELETE trigger bodies run against keyed tables, reading current state each firing. One body statement touching the same target row for two triggering rows in one firing is rejected; separate body statements may each touch that row."
|
|
680
680
|
},
|
|
681
681
|
{
|
|
682
682
|
"id": "trigger.drop",
|
|
@@ -700,7 +700,7 @@
|
|
|
700
700
|
"id": "expression.concat",
|
|
701
701
|
"status": "supported",
|
|
702
702
|
"example": "SELECT region || '-' || label AS tag FROM dims",
|
|
703
|
-
"notes": "|| concatenates strings and propagates NULL; non-string operands are a type error."
|
|
703
|
+
"notes": "|| concatenates strings and propagates NULL; non-string operands are a type error. One operand must be ordinary text, matching PostgreSQL's operator resolution: array and JSONB || are structural concatenation (see array.concat and json.concat), and two non-text domain operands have no || operator. A domain value concatenated with text renders in its Minnow text form."
|
|
704
704
|
},
|
|
705
705
|
{
|
|
706
706
|
"id": "expression.modulo",
|
|
@@ -730,7 +730,7 @@
|
|
|
730
730
|
"id": "expression.coalesce",
|
|
731
731
|
"status": "supported",
|
|
732
732
|
"example": "SELECT COALESCE(region, 'unknown') AS region_label FROM rows",
|
|
733
|
-
"notes": "Arguments evaluate left to right; the first non-NULL value wins.
|
|
733
|
+
"notes": "Arguments evaluate left to right; the first non-NULL value wins. Arguments are not type-checked: mixed-type arguments are accepted and return the first non-NULL value as-is, where PostgreSQL requires a common type."
|
|
734
734
|
},
|
|
735
735
|
{
|
|
736
736
|
"id": "expression.date-trunc",
|
|
@@ -958,7 +958,7 @@
|
|
|
958
958
|
"id": "datetime.localtime",
|
|
959
959
|
"status": "supported",
|
|
960
960
|
"example": "SELECT LOCALTIME IS NOT NULL AS ticking",
|
|
961
|
-
"notes": "
|
|
961
|
+
"notes": "LOCALTIME reads as an 'HH:MM:SS' string of the current UTC time, like SQLite's CURRENT_TIME — Minnow has no session time zone, where PostgreSQL renders the session-local wall clock."
|
|
962
962
|
},
|
|
963
963
|
{
|
|
964
964
|
"id": "predicate.row-comparison",
|
|
@@ -985,6 +985,24 @@
|
|
|
985
985
|
"status": "supported",
|
|
986
986
|
"example": "SELECT 1_000 AS thousand"
|
|
987
987
|
},
|
|
988
|
+
{
|
|
989
|
+
"id": "literal.exact-decimal",
|
|
990
|
+
"status": "supported",
|
|
991
|
+
"example": "SELECT 1.000000000000000000000000 / 3 = CAST('0.333333333333333333333333' AS NUMERIC) AS exact_thirds",
|
|
992
|
+
"notes": "Decimal constants keep their exact digits, as PostgreSQL's NUMERIC typing does. Arithmetic among constants is exact — 0.1 + 0.2 is 0.3 — and a quotient's scale follows the operands' written scales. A result that reads back identically from a JavaScript number is returned as a number; one the number boundary would visibly round is returned as an exact decimal string."
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
"id": "literal.big-integer",
|
|
996
|
+
"status": "supported",
|
|
997
|
+
"example": "SELECT 10000000000000000001 = CAST('10000000000000000001' AS NUMERIC) AS same",
|
|
998
|
+
"notes": "An integer constant beyond 2^53 stays exact instead of rounding or failing. A value Float64 cannot hold is returned as a decimal string, and writing one to an INTEGER or BIGINT column is rejected rather than silently rounded."
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
"id": "literal.scientific",
|
|
1002
|
+
"status": "supported",
|
|
1003
|
+
"example": "SELECT 2.5e-1 AS quarter",
|
|
1004
|
+
"notes": "Scientific notation is a numeric constant, as in PostgreSQL. PostgreSQL renders every such constant as NUMERIC text; Minnow returns a number when the value reads back identically from one, and renders a constant that stays exact fully expanded, as PostgreSQL renders it."
|
|
1005
|
+
},
|
|
988
1006
|
{
|
|
989
1007
|
"id": "limit.with-ties",
|
|
990
1008
|
"status": "supported",
|
|
@@ -1075,7 +1093,7 @@
|
|
|
1075
1093
|
"id": "json.array",
|
|
1076
1094
|
"status": "supported",
|
|
1077
1095
|
"example": "SELECT JSON_ARRAY(1, NULL, 2) AS document",
|
|
1078
|
-
"notes": "Defaults to NULL ON NULL. The explicit NULL/ABSENT clause is not supported. The constructor returns JSON text; cast or store it as JSON/JSONB for domain validation and JSONB canonicalization."
|
|
1096
|
+
"notes": "Defaults to NULL ON NULL, unlike PostgreSQL's ABSENT ON NULL default for JSON_ARRAY. The explicit NULL/ABSENT clause is not supported. The constructor returns JSON text; cast or store it as JSON/JSONB for domain validation and JSONB canonicalization."
|
|
1079
1097
|
},
|
|
1080
1098
|
{
|
|
1081
1099
|
"id": "json.arrow",
|
|
@@ -1138,7 +1156,7 @@
|
|
|
1138
1156
|
"id": "type.exact-numeric",
|
|
1139
1157
|
"status": "supported",
|
|
1140
1158
|
"example": "SELECT CAST(1.25 AS DECIMAL(12, 2)) AS amount",
|
|
1141
|
-
"notes": "Exact through storage, arithmetic, comparison, aggregates, and windows. Division
|
|
1159
|
+
"notes": "Exact through storage, arithmetic, comparison, aggregates, and windows. Division selects its result scale the way PostgreSQL does: at least sixteen significant digits, never fewer fractional digits than either operand, rounded half away from zero."
|
|
1142
1160
|
},
|
|
1143
1161
|
{
|
|
1144
1162
|
"id": "type.json-jsonb",
|
|
@@ -1155,8 +1173,15 @@
|
|
|
1155
1173
|
{
|
|
1156
1174
|
"id": "type.interval",
|
|
1157
1175
|
"status": "supported",
|
|
1158
|
-
"example": "SELECT
|
|
1159
|
-
"notes": "Preserves separate month, day, and microsecond fields. Interval arithmetic is not
|
|
1176
|
+
"example": "SELECT joined + INTERVAL '1 day' AS next_day FROM rows",
|
|
1177
|
+
"notes": "Preserves separate month, day, and microsecond fields, and a date or datetime accepts + and - INTERVAL. Interval-valued arithmetic is not supported (see type.interval-arithmetic)."
|
|
1178
|
+
},
|
|
1179
|
+
{
|
|
1180
|
+
"id": "type.interval-arithmetic",
|
|
1181
|
+
"status": "unsupported",
|
|
1182
|
+
"example": "SELECT INTERVAL '1 day' + INTERVAL '2 hours' AS total",
|
|
1183
|
+
"error": "Date arithmetic requires a date or datetime value",
|
|
1184
|
+
"notes": "PostgreSQL adds intervals into a combined interval and subtracts timestamps into an interval. Minnow's interval arithmetic only shifts a date or datetime by + or - INTERVAL, so an interval-valued result is refused."
|
|
1160
1185
|
},
|
|
1161
1186
|
{
|
|
1162
1187
|
"id": "ddl.enum",
|
|
@@ -1263,7 +1288,14 @@
|
|
|
1263
1288
|
"id": "json.table",
|
|
1264
1289
|
"status": "supported",
|
|
1265
1290
|
"example": "SELECT j.a FROM JSON_TABLE('{\"a\":1}', '$' COLUMNS (a INTEGER PATH '$.a')) AS j",
|
|
1266
|
-
"notes": "Constant documents support $ and $[*] row paths.
|
|
1291
|
+
"notes": "Constant documents support $ and $[*] row paths. A document read from row data is refused (see json.table-correlated)."
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
"id": "json.table-correlated",
|
|
1295
|
+
"status": "unsupported",
|
|
1296
|
+
"example": "SELECT jt.v FROM (SELECT '[1,2]' AS document) AS d, JSON_TABLE(d.document, '$[*]' COLUMNS (v INTEGER PATH '$')) AS jt",
|
|
1297
|
+
"error": "JSON_TABLE currently requires a constant document",
|
|
1298
|
+
"notes": "PostgreSQL evaluates JSON_TABLE laterally against each source row's document. Minnow expands only constant documents, so a column-valued document is refused at compile time."
|
|
1267
1299
|
},
|
|
1268
1300
|
{
|
|
1269
1301
|
"id": "predicate.similar-to",
|
|
@@ -1287,7 +1319,35 @@
|
|
|
1287
1319
|
"id": "type.array",
|
|
1288
1320
|
"status": "supported",
|
|
1289
1321
|
"example": "SELECT ARRAY[1, 2] AS pair",
|
|
1290
|
-
"notes": "Constructors and array columns use canonical JSON text at the JavaScript boundary. Subscripts and array operators are not
|
|
1322
|
+
"notes": "Constructors and array columns use canonical JSON text at the JavaScript boundary. Subscripts and array operators are not supported (see type.array-subscript, type.array-any, and array.concat)."
|
|
1323
|
+
},
|
|
1324
|
+
{
|
|
1325
|
+
"id": "type.array-subscript",
|
|
1326
|
+
"status": "unsupported",
|
|
1327
|
+
"example": "SELECT (ARRAY[1, 2, 3])[1] AS first_element",
|
|
1328
|
+
"error": "Array subscripts are not supported",
|
|
1329
|
+
"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."
|
|
1330
|
+
},
|
|
1331
|
+
{
|
|
1332
|
+
"id": "type.array-any",
|
|
1333
|
+
"status": "unsupported",
|
|
1334
|
+
"example": "SELECT 2 = ANY(ARRAY[1, 2, 3]) AS found",
|
|
1335
|
+
"error": "ANY/ALL take a subquery",
|
|
1336
|
+
"notes": "PostgreSQL's ANY, ALL, and SOME accept an array operand as well as a subquery. Minnow implements only the subquery form, so the array variant is refused at compile time."
|
|
1337
|
+
},
|
|
1338
|
+
{
|
|
1339
|
+
"id": "array.concat",
|
|
1340
|
+
"status": "unsupported",
|
|
1341
|
+
"example": "SELECT ARRAY[1, 2] || ARRAY[3] AS combined",
|
|
1342
|
+
"error": "PostgreSQL array concatenation (||) is not supported",
|
|
1343
|
+
"notes": "PostgreSQL's array || array and array || element are structural concatenation. Minnow refuses || whenever either operand is an array rather than inventing a text concatenation PostgreSQL does not have."
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
"id": "json.concat",
|
|
1347
|
+
"status": "unsupported",
|
|
1348
|
+
"example": "SELECT CAST('{\"a\":1}' AS JSONB) || CAST('{\"b\":2}' AS JSONB) AS merged",
|
|
1349
|
+
"error": "PostgreSQL JSONB concatenation (||) is not supported",
|
|
1350
|
+
"notes": "PostgreSQL's jsonb || jsonb merges documents structurally. Minnow refuses || whenever either operand is JSONB rather than inventing a text concatenation PostgreSQL does not have."
|
|
1291
1351
|
},
|
|
1292
1352
|
{
|
|
1293
1353
|
"id": "type.time",
|
|
@@ -1318,7 +1378,7 @@
|
|
|
1318
1378
|
"id": "ddl.create-view",
|
|
1319
1379
|
"status": "supported",
|
|
1320
1380
|
"example": "CREATE VIEW west AS SELECT region, amount FROM rows WHERE region = 'west'",
|
|
1321
|
-
"notes": "The catalog stores the query text and inferred schema, so reads expand a view anywhere a table can be read, including inside a write scope. A view is never a write target. CREATE OR REPLACE redefines one; dependent views follow it and
|
|
1381
|
+
"notes": "The catalog stores the query text and inferred schema, so reads expand a view anywhere a table can be read, including inside a write scope. A view is never a write target. CREATE OR REPLACE redefines one; dependent views follow it, and a definition that would create a cycle is rejected when the view is defined. CREATE VIEW column-name lists are not supported."
|
|
1322
1382
|
},
|
|
1323
1383
|
{
|
|
1324
1384
|
"id": "ddl.drop-view",
|