@crvouga/postgres-mem 0.1.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.
Files changed (109) hide show
  1. package/AGENTS.md +159 -0
  2. package/COMPATIBILITY-AUDIT.md +155 -0
  3. package/COMPATIBILITY.md +87 -0
  4. package/LICENSE +21 -0
  5. package/README.md +325 -0
  6. package/compat/coverage.json +1081 -0
  7. package/compat/divergences.json +191 -0
  8. package/compat/gate-report.json +80 -0
  9. package/compat/requirements.json +1105 -0
  10. package/compat/requirements.raw.html +484 -0
  11. package/compat/scenario-types.ts +98 -0
  12. package/compat/scenarios.ts +98 -0
  13. package/compat/sections/agg.ts +45 -0
  14. package/compat/sections/api.ts +28 -0
  15. package/compat/sections/arr.ts +45 -0
  16. package/compat/sections/cat.ts +47 -0
  17. package/compat/sections/con.ts +32 -0
  18. package/compat/sections/cpy.ts +24 -0
  19. package/compat/sections/cte.ts +29 -0
  20. package/compat/sections/dat.ts +60 -0
  21. package/compat/sections/ddl.ts +55 -0
  22. package/compat/sections/det.ts +20 -0
  23. package/compat/sections/dml.ts +37 -0
  24. package/compat/sections/eco.ts +16 -0
  25. package/compat/sections/err.ts +16 -0
  26. package/compat/sections/exp.ts +53 -0
  27. package/compat/sections/fun.ts +58 -0
  28. package/compat/sections/fzz.ts +36 -0
  29. package/compat/sections/guc.ts +27 -0
  30. package/compat/sections/joi.ts +33 -0
  31. package/compat/sections/jsn.ts +46 -0
  32. package/compat/sections/lim.ts +13 -0
  33. package/compat/sections/par.ts +61 -0
  34. package/compat/sections/pre.ts +26 -0
  35. package/compat/sections/sch.ts +31 -0
  36. package/compat/sections/sel.ts +43 -0
  37. package/compat/sections/seq.ts +31 -0
  38. package/compat/sections/snp.ts +21 -0
  39. package/compat/sections/tok.ts +53 -0
  40. package/compat/sections/trg.ts +57 -0
  41. package/compat/sections/tsr.ts +37 -0
  42. package/compat/sections/txn.ts +39 -0
  43. package/compat/sections/typ.ts +55 -0
  44. package/compat/sections/uni.ts +13 -0
  45. package/compat/sections/win.ts +43 -0
  46. package/compat/smoke-baseline.json +3 -0
  47. package/compat/unsupported-register.json +2526 -0
  48. package/dist/api/bind.d.ts +10 -0
  49. package/dist/api/database.d.ts +69 -0
  50. package/dist/api/statement.d.ts +51 -0
  51. package/dist/ast/nodes.d.ts +810 -0
  52. package/dist/constraints/enforce.d.ts +39 -0
  53. package/dist/errors/error.d.ts +24 -0
  54. package/dist/executor/ddl.d.ts +23 -0
  55. package/dist/executor/dml.d.ts +10 -0
  56. package/dist/executor/execute.d.ts +11 -0
  57. package/dist/executor/relation.d.ts +60 -0
  58. package/dist/executor/select.d.ts +41 -0
  59. package/dist/executor/session.d.ts +21 -0
  60. package/dist/executor/triggers-exec.d.ts +1 -0
  61. package/dist/executor/triggers.d.ts +16 -0
  62. package/dist/executor/window.d.ts +13 -0
  63. package/dist/expressions/context.d.ts +23 -0
  64. package/dist/expressions/eval.d.ts +38 -0
  65. package/dist/expressions/operators.d.ts +8 -0
  66. package/dist/expressions/pattern.d.ts +20 -0
  67. package/dist/functions/aggregates.d.ts +17 -0
  68. package/dist/functions/array-fns.d.ts +2 -0
  69. package/dist/functions/datetime-fns.d.ts +26 -0
  70. package/dist/functions/datetime-registry.d.ts +2 -0
  71. package/dist/functions/json-fns.d.ts +7 -0
  72. package/dist/functions/math-fns.d.ts +2 -0
  73. package/dist/functions/misc-fns.d.ts +8 -0
  74. package/dist/functions/scalar.d.ts +10 -0
  75. package/dist/functions/srf.d.ts +12 -0
  76. package/dist/functions/string-fns.d.ts +4 -0
  77. package/dist/functions/tsearch-fns.d.ts +2 -0
  78. package/dist/functions/util.d.ts +14 -0
  79. package/dist/functions/window.d.ts +7 -0
  80. package/dist/index.d.ts +28 -0
  81. package/dist/index.js +19591 -0
  82. package/dist/index.js.map +7 -0
  83. package/dist/lexer/tokenize.d.ts +8 -0
  84. package/dist/parser/index.d.ts +1 -0
  85. package/dist/parser/parser.d.ts +96 -0
  86. package/dist/runtime/clock.d.ts +14 -0
  87. package/dist/runtime/index.d.ts +3 -0
  88. package/dist/runtime/options.d.ts +25 -0
  89. package/dist/runtime/prng.d.ts +48 -0
  90. package/dist/schema/catalog-tables.d.ts +1 -0
  91. package/dist/schema/catalog.d.ts +12 -0
  92. package/dist/serialization/codec.d.ts +29 -0
  93. package/dist/serialization/index.d.ts +1 -0
  94. package/dist/storage/database-state.d.ts +216 -0
  95. package/dist/transactions/manager.d.ts +25 -0
  96. package/dist/tsearch/stem.d.ts +5 -0
  97. package/dist/tsearch/tsearch.d.ts +59 -0
  98. package/dist/types/cast.d.ts +26 -0
  99. package/dist/types/compare.d.ts +18 -0
  100. package/dist/types/datetime.d.ts +68 -0
  101. package/dist/types/jsonb.d.ts +45 -0
  102. package/dist/types/numeric.d.ts +69 -0
  103. package/dist/types/resolve.d.ts +15 -0
  104. package/dist/types/timezone.d.ts +9 -0
  105. package/dist/types/value.d.ts +99 -0
  106. package/dist/unstable.d.ts +15 -0
  107. package/dist/unstable.js +19153 -0
  108. package/dist/unstable.js.map +7 -0
  109. package/package.json +120 -0
@@ -0,0 +1,191 @@
1
+ {
2
+ "version": 1,
3
+ "entries": [
4
+ {
5
+ "id": "oracle-pglite-version",
6
+ "scope": "oracle",
7
+ "predicate": "The differential oracle is PGlite (embedded PostgreSQL 18.x WASM); server_version must be 18.3 or 18.1",
8
+ "specifiedBehavior": "Harness bootstrap asserts current_setting('server_version') is in {18.3, 18.1}. Differential results are only meaningful against these lines.",
9
+ "pinnedBy": ["scripts/postgres-compat-gate.ts", "tests/harness/oracle-versions.ts"]
10
+ },
11
+ {
12
+ "id": "deterministic-runtime",
13
+ "scope": "engine",
14
+ "predicate": "random()/gen_random_uuid() are seeded-deterministic and now() is fixed to 2000-01-01 UTC by default; both are injectable via DatabaseOptions; the PRNG participates in transaction rollback and snapshots",
15
+ "specifiedBehavior": "By design, two Database instances with the same seed produce identical random streams and identical now() values. PostgreSQL is wall-clock and entropy driven. Tests assert memory behavior only.",
16
+ "pinnedBy": [
17
+ "DAT-now-01",
18
+ "DET-seed-01",
19
+ "DET-seed-02",
20
+ "DET-now-01",
21
+ "DET-now-02",
22
+ "DET-uuid-01",
23
+ "DET-rb-01",
24
+ "DET-snap-01",
25
+ "DET-setseed-01",
26
+ "DET-scan-01",
27
+ "tests/contract/determinism/basic.test.ts"
28
+ ]
29
+ },
30
+ {
31
+ "id": "pgmm-snapshot-codec",
32
+ "scope": "engine",
33
+ "predicate": "snapshot()/restore() use the custom PGMM binary codec (magic 'PGMM' + LE u32 version), not pg_dump or the on-disk PostgreSQL format",
34
+ "specifiedBehavior": "Snapshots are byte-identical for equivalent logical state, refuse corrupt/truncated/future-version blobs, and cannot run inside a transaction. No PostgreSQL equivalent exists; tests assert memory behavior only.",
35
+ "pinnedBy": [
36
+ "SNP-rt-01",
37
+ "SNP-rt-02",
38
+ "SNP-rt-03",
39
+ "SNP-rt-04",
40
+ "SNP-rt-05",
41
+ "SNP-byte-01",
42
+ "SNP-hdr-01",
43
+ "SNP-hdr-02",
44
+ "SNP-hdr-03",
45
+ "SNP-hdr-04",
46
+ "SNP-txn-01",
47
+ "SNP-rep-01",
48
+ "tests/contract/snapshots/basic.test.ts"
49
+ ]
50
+ },
51
+ {
52
+ "id": "copy-stdin-api",
53
+ "scope": "api",
54
+ "predicate": "COPY ... FROM STDIN is fed through the copyFrom(sql, text) API hook and COPY ... TO STDOUT returns the rendered text from exec; PGlite exposes a different (protocol-level) COPY interface",
55
+ "specifiedBehavior": "Text and CSV COPY semantics (\\N nulls, escapes, \\. terminator, HEADER/DELIMITER/NULL options, column lists) follow PostgreSQL 18; the transport is the JS API rather than the wire protocol, so these are memory-only assertions.",
56
+ "pinnedBy": [
57
+ "CPY-from-01",
58
+ "CPY-from-02",
59
+ "CPY-from-03",
60
+ "CPY-from-04",
61
+ "CPY-from-05",
62
+ "CPY-csv-01",
63
+ "CPY-csv-02",
64
+ "CPY-csv-03",
65
+ "CPY-to-01",
66
+ "CPY-to-02",
67
+ "CPY-to-03",
68
+ "CPY-to-04",
69
+ "CPY-rt-01",
70
+ "CPY-api-01",
71
+ "tests/contract/copy/basic.test.ts"
72
+ ]
73
+ },
74
+ {
75
+ "id": "sync-api-surface",
76
+ "scope": "api",
77
+ "predicate": "The public Database/Statement API is synchronous (exec/query/prepare/transaction/snapshot/restore/close return values, not Promises); PGlite and pg clients are asynchronous",
78
+ "specifiedBehavior": "API shape mirrors sqlite-mem: run/all/get/result, $1..$n parameters, bigint for int8, canonical text for numeric/date/jsonb, misuse errors for wrong usage. Asserted memory-only because no PostgreSQL client shares this surface.",
79
+ "pinnedBy": [
80
+ "API-exec-01",
81
+ "API-exec-02",
82
+ "API-query-01",
83
+ "API-prep-01",
84
+ "API-run-01",
85
+ "API-run-02",
86
+ "API-run-03",
87
+ "API-bind-02",
88
+ "API-bind-03",
89
+ "API-ret-01",
90
+ "API-ret-02",
91
+ "API-close-01",
92
+ "API-txn-01",
93
+ "API-txn-02",
94
+ "API-sync-01",
95
+ "API-copy-01",
96
+ "tests/contract/api/basic.test.ts"
97
+ ]
98
+ },
99
+ {
100
+ "id": "empty-script-rejected",
101
+ "scope": "sql",
102
+ "predicate": "exec of a statement-free script (comments/whitespace only) raises an empty-statement error; PostgreSQL accepts it as a no-op",
103
+ "specifiedBehavior": "postgres-mem requires at least one statement per exec call.",
104
+ "pinnedBy": ["TOK-cmt-04"]
105
+ },
106
+ {
107
+ "id": "row-value-subquery-arity",
108
+ "scope": "sql",
109
+ "predicate": "Row-constructor arity mismatches surface at execution (21000) instead of parse time (42601), and multi-column row-value IN (SELECT ...) is rejected as unsupported",
110
+ "specifiedBehavior": "Single-column IN subqueries have full parity; multi-column row-value subquery comparison is out of scope for this milestone and fails loud.",
111
+ "pinnedBy": ["PAR-row-03", "EXP-in-03"]
112
+ },
113
+ {
114
+ "id": "unary-minus-folding",
115
+ "scope": "sql",
116
+ "predicate": "Repeated unary minus is folded into the numeric literal during parse, so '- -5' is rejected; PostgreSQL evaluates it to 5",
117
+ "specifiedBehavior": "Use parentheses (-(-5)) for nested negation.",
118
+ "pinnedBy": ["PAR-neg-01"]
119
+ },
120
+ {
121
+ "id": "float8-overflow-saturates",
122
+ "scope": "sql",
123
+ "predicate": "'1e400'::float8 saturates to Infinity instead of raising 22003 out of range",
124
+ "specifiedBehavior": "float8 text input uses JS Number parsing, which saturates. In-range values have full parity.",
125
+ "pinnedBy": ["TYP-float-04"]
126
+ },
127
+ {
128
+ "id": "round-half-away-from-zero",
129
+ "scope": "sql",
130
+ "predicate": "round(float8) rounds ties away from zero (round(2.5::float8) = 3); PostgreSQL rounds half to even (= 2)",
131
+ "specifiedBehavior": "numeric round() has full parity; only the float8 overload diverges on exact .5 ties.",
132
+ "pinnedBy": ["FUN-round-02"]
133
+ },
134
+ {
135
+ "id": "drop-cascade-view-retained",
136
+ "scope": "sql",
137
+ "predicate": "DROP TABLE ... CASCADE does not drop dependent views; the view remains and errors when queried",
138
+ "specifiedBehavior": "Dependency tracking for CASCADE drops of views is not implemented; drop the view explicitly.",
139
+ "pinnedBy": ["DDL-drop-03"]
140
+ },
141
+ {
142
+ "id": "comment-on-not-stored",
143
+ "scope": "sql",
144
+ "predicate": "COMMENT ON parses and succeeds but the comment is not stored; obj_description() returns NULL",
145
+ "specifiedBehavior": "COMMENT ON is accepted for compatibility; descriptions are not persisted.",
146
+ "pinnedBy": ["DDL-comment-01"]
147
+ },
148
+ {
149
+ "id": "trigger-order-creation",
150
+ "scope": "sql",
151
+ "predicate": "Multiple triggers on the same event fire in creation order; PostgreSQL fires them in name order",
152
+ "specifiedBehavior": "Name your triggers so alphabetical order matches creation order if ordering matters.",
153
+ "pinnedBy": ["TRG-order-01"]
154
+ },
155
+ {
156
+ "id": "trigger-update-of-ignored",
157
+ "scope": "sql",
158
+ "predicate": "UPDATE OF column lists on triggers are parsed but ignored; the trigger fires for every UPDATE",
159
+ "specifiedBehavior": "Column-filtered trigger firing is not implemented; guard inside the trigger body instead.",
160
+ "pinnedBy": ["TRG-updof-01"]
161
+ },
162
+ {
163
+ "id": "instead-of-triggers-unsupported",
164
+ "scope": "sql",
165
+ "predicate": "CREATE TRIGGER ... INSTEAD OF on a view fails loud; PostgreSQL supports INSTEAD OF triggers on views",
166
+ "specifiedBehavior": "INSTEAD OF triggers are out of scope for this milestone.",
167
+ "pinnedBy": ["TRG-instead-01"]
168
+ },
169
+ {
170
+ "id": "no-aborted-transaction-state",
171
+ "scope": "sql",
172
+ "predicate": "After a failed statement inside BEGIN, subsequent statements keep executing; PostgreSQL rejects them with 25P02 until ROLLBACK",
173
+ "specifiedBehavior": "The aborted-transaction latch is not implemented; each statement is validated independently.",
174
+ "pinnedBy": ["TXN-abort-01"]
175
+ },
176
+ {
177
+ "id": "version-banner",
178
+ "scope": "catalog",
179
+ "predicate": "version() returns 'PostgreSQL 18.3 (postgres-mem) on TypeScript, in-memory engine' instead of the real build banner",
180
+ "specifiedBehavior": "server_version/server_version_num report 18.3/180003 for compatibility; the full banner names postgres-mem.",
181
+ "pinnedBy": ["CAT-ver-01"]
182
+ },
183
+ {
184
+ "id": "pg-get-viewdef-missing",
185
+ "scope": "catalog",
186
+ "predicate": "pg_get_viewdef() is not implemented and raises 42883",
187
+ "specifiedBehavior": "View definitions are visible via information_schema.views.view_definition (stored SQL text).",
188
+ "pinnedBy": ["CAT-viewdef-01"]
189
+ }
190
+ ]
191
+ }
@@ -0,0 +1,80 @@
1
+ {
2
+ "generatedAt": "2026-08-21T19:16:17.602Z",
3
+ "referenceServerVersion": "18.3",
4
+ "inventory": {
5
+ "oracleFunctionCount": 2787,
6
+ "oracleOperatorCount": 74,
7
+ "implementedFunctions": 301,
8
+ "registeredUnsupportedFunctions": 2486,
9
+ "implementedOperators": [
10
+ "!~",
11
+ "!~*",
12
+ "!~~",
13
+ "!~~*",
14
+ "#",
15
+ "#-",
16
+ "#>",
17
+ "#>>",
18
+ "%",
19
+ "&",
20
+ "&&",
21
+ "*",
22
+ "+",
23
+ "-",
24
+ "->",
25
+ "->>",
26
+ "/",
27
+ "<",
28
+ "<<",
29
+ "<=",
30
+ "<>",
31
+ "<@",
32
+ "=",
33
+ ">",
34
+ ">=",
35
+ ">>",
36
+ "?",
37
+ "?&",
38
+ "?|",
39
+ "@",
40
+ "@>",
41
+ "@@",
42
+ "^",
43
+ "|",
44
+ "|/",
45
+ "||",
46
+ "||/",
47
+ "~",
48
+ "~*",
49
+ "~~",
50
+ "~~*"
51
+ ],
52
+ "registeredUnsupportedOperators": 33,
53
+ "memoryOnlyFunctions": [
54
+ "current_catalog",
55
+ "current_date",
56
+ "current_role",
57
+ "current_time",
58
+ "current_timestamp",
59
+ "json_is_valid_check",
60
+ "jsonb_object_keys_check",
61
+ "localtime",
62
+ "localtimestamp",
63
+ "pg_listening_channels_check",
64
+ "substring_similar",
65
+ "trim",
66
+ "tsvector_in_check",
67
+ "tsvector_length",
68
+ "user"
69
+ ]
70
+ },
71
+ "scenarios": {
72
+ "sections": 33,
73
+ "promoted": 33,
74
+ "total": 945,
75
+ "mapped": 945,
76
+ "smoke": 0
77
+ },
78
+ "failures": [],
79
+ "ok": true
80
+ }