@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.
- package/AGENTS.md +159 -0
- package/COMPATIBILITY-AUDIT.md +155 -0
- package/COMPATIBILITY.md +87 -0
- package/LICENSE +21 -0
- package/README.md +325 -0
- package/compat/coverage.json +1081 -0
- package/compat/divergences.json +191 -0
- package/compat/gate-report.json +80 -0
- package/compat/requirements.json +1105 -0
- package/compat/requirements.raw.html +484 -0
- package/compat/scenario-types.ts +98 -0
- package/compat/scenarios.ts +98 -0
- package/compat/sections/agg.ts +45 -0
- package/compat/sections/api.ts +28 -0
- package/compat/sections/arr.ts +45 -0
- package/compat/sections/cat.ts +47 -0
- package/compat/sections/con.ts +32 -0
- package/compat/sections/cpy.ts +24 -0
- package/compat/sections/cte.ts +29 -0
- package/compat/sections/dat.ts +60 -0
- package/compat/sections/ddl.ts +55 -0
- package/compat/sections/det.ts +20 -0
- package/compat/sections/dml.ts +37 -0
- package/compat/sections/eco.ts +16 -0
- package/compat/sections/err.ts +16 -0
- package/compat/sections/exp.ts +53 -0
- package/compat/sections/fun.ts +58 -0
- package/compat/sections/fzz.ts +36 -0
- package/compat/sections/guc.ts +27 -0
- package/compat/sections/joi.ts +33 -0
- package/compat/sections/jsn.ts +46 -0
- package/compat/sections/lim.ts +13 -0
- package/compat/sections/par.ts +61 -0
- package/compat/sections/pre.ts +26 -0
- package/compat/sections/sch.ts +31 -0
- package/compat/sections/sel.ts +43 -0
- package/compat/sections/seq.ts +31 -0
- package/compat/sections/snp.ts +21 -0
- package/compat/sections/tok.ts +53 -0
- package/compat/sections/trg.ts +57 -0
- package/compat/sections/tsr.ts +37 -0
- package/compat/sections/txn.ts +39 -0
- package/compat/sections/typ.ts +55 -0
- package/compat/sections/uni.ts +13 -0
- package/compat/sections/win.ts +43 -0
- package/compat/smoke-baseline.json +3 -0
- package/compat/unsupported-register.json +2526 -0
- package/dist/api/bind.d.ts +10 -0
- package/dist/api/database.d.ts +69 -0
- package/dist/api/statement.d.ts +51 -0
- package/dist/ast/nodes.d.ts +810 -0
- package/dist/constraints/enforce.d.ts +39 -0
- package/dist/errors/error.d.ts +24 -0
- package/dist/executor/ddl.d.ts +23 -0
- package/dist/executor/dml.d.ts +10 -0
- package/dist/executor/execute.d.ts +11 -0
- package/dist/executor/relation.d.ts +60 -0
- package/dist/executor/select.d.ts +41 -0
- package/dist/executor/session.d.ts +21 -0
- package/dist/executor/triggers-exec.d.ts +1 -0
- package/dist/executor/triggers.d.ts +16 -0
- package/dist/executor/window.d.ts +13 -0
- package/dist/expressions/context.d.ts +23 -0
- package/dist/expressions/eval.d.ts +38 -0
- package/dist/expressions/operators.d.ts +8 -0
- package/dist/expressions/pattern.d.ts +20 -0
- package/dist/functions/aggregates.d.ts +17 -0
- package/dist/functions/array-fns.d.ts +2 -0
- package/dist/functions/datetime-fns.d.ts +26 -0
- package/dist/functions/datetime-registry.d.ts +2 -0
- package/dist/functions/json-fns.d.ts +7 -0
- package/dist/functions/math-fns.d.ts +2 -0
- package/dist/functions/misc-fns.d.ts +8 -0
- package/dist/functions/scalar.d.ts +10 -0
- package/dist/functions/srf.d.ts +12 -0
- package/dist/functions/string-fns.d.ts +4 -0
- package/dist/functions/tsearch-fns.d.ts +2 -0
- package/dist/functions/util.d.ts +14 -0
- package/dist/functions/window.d.ts +7 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +19591 -0
- package/dist/index.js.map +7 -0
- package/dist/lexer/tokenize.d.ts +8 -0
- package/dist/parser/index.d.ts +1 -0
- package/dist/parser/parser.d.ts +96 -0
- package/dist/runtime/clock.d.ts +14 -0
- package/dist/runtime/index.d.ts +3 -0
- package/dist/runtime/options.d.ts +25 -0
- package/dist/runtime/prng.d.ts +48 -0
- package/dist/schema/catalog-tables.d.ts +1 -0
- package/dist/schema/catalog.d.ts +12 -0
- package/dist/serialization/codec.d.ts +29 -0
- package/dist/serialization/index.d.ts +1 -0
- package/dist/storage/database-state.d.ts +216 -0
- package/dist/transactions/manager.d.ts +25 -0
- package/dist/tsearch/stem.d.ts +5 -0
- package/dist/tsearch/tsearch.d.ts +59 -0
- package/dist/types/cast.d.ts +26 -0
- package/dist/types/compare.d.ts +18 -0
- package/dist/types/datetime.d.ts +68 -0
- package/dist/types/jsonb.d.ts +45 -0
- package/dist/types/numeric.d.ts +69 -0
- package/dist/types/resolve.d.ts +15 -0
- package/dist/types/timezone.d.ts +9 -0
- package/dist/types/value.d.ts +99 -0
- package/dist/unstable.d.ts +15 -0
- package/dist/unstable.js +19153 -0
- package/dist/unstable.js.map +7 -0
- package/package.json +120 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
export const TSR_SECTION: CatalogSection = section("TSR", "Full text search", true, [
|
|
4
|
+
["vec-01", "to_tsvector english stems and positions"],
|
|
5
|
+
["vec-02", "to_tsvector default config"],
|
|
6
|
+
["vec-03", "to_tsvector simple config keeps stop words"],
|
|
7
|
+
["vec-04", "repeated lexemes keep all positions"],
|
|
8
|
+
["vec-05", "to_tsvector of an empty string"],
|
|
9
|
+
["qry-01", "to_tsquery with AND"],
|
|
10
|
+
["qry-02", "to_tsquery with OR and NOT"],
|
|
11
|
+
["qry-03", "to_tsquery stems terms"],
|
|
12
|
+
["qry-04", "plainto_tsquery ANDs plain words"],
|
|
13
|
+
["qry-05", "phraseto_tsquery builds a phrase query"],
|
|
14
|
+
["lit-01", "tsvector literal cast"],
|
|
15
|
+
["lit-02", "tsvector literal with positions"],
|
|
16
|
+
["lit-03", "tsquery literal cast"],
|
|
17
|
+
["match-01", "@@ matches a stemmed word"],
|
|
18
|
+
["match-02", "@@ no match returns false"],
|
|
19
|
+
["match-03", "@@ with AND requires both terms"],
|
|
20
|
+
["match-04", "@@ with OR requires either term"],
|
|
21
|
+
["match-05", "@@ with NOT excludes matches"],
|
|
22
|
+
["match-06", "@@ over table rows"],
|
|
23
|
+
["cat-01", "tsvector || concatenation shifts positions"],
|
|
24
|
+
["op-01", "tsquery && combines with AND"],
|
|
25
|
+
["op-02", "tsquery || combines with OR"],
|
|
26
|
+
["op-03", "!! negates a tsquery"],
|
|
27
|
+
["phrase-01", "phrase operator <-> inside to_tsquery"],
|
|
28
|
+
["phrase-02", "phrase distance <2> matches exactly two apart"],
|
|
29
|
+
["weight-01", "setweight assigns a weight"],
|
|
30
|
+
["weight-02", "setweight combined with concatenation"],
|
|
31
|
+
["strip-01", "strip removes positions and weights"],
|
|
32
|
+
["len-01", "length counts distinct lexemes"],
|
|
33
|
+
["rank-01", "ts_rank for a simple match"],
|
|
34
|
+
["rank-02", "ts_rank ordering over table rows"],
|
|
35
|
+
["head-01", "ts_headline wraps matches in default markers"],
|
|
36
|
+
["head-02", "ts_headline with custom start and stop markers"],
|
|
37
|
+
]);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
const D = "documented_divergence" as const;
|
|
4
|
+
|
|
5
|
+
export const TXN_SECTION: CatalogSection = section("TXN", "Transactions and savepoints", true, [
|
|
6
|
+
["commit-01", "committed insert visible after COMMIT"],
|
|
7
|
+
["commit-02", "changes visible inside the txn before commit"],
|
|
8
|
+
["commit-03", "sequential transactions accumulate committed work"],
|
|
9
|
+
["rollback-01", "ROLLBACK discards inserts"],
|
|
10
|
+
["rollback-02", "ROLLBACK discards updates"],
|
|
11
|
+
["rollback-03", "ROLLBACK discards deletes"],
|
|
12
|
+
["ddl-01", "CREATE TABLE rolled back"],
|
|
13
|
+
["ddl-02", "CREATE TABLE committed"],
|
|
14
|
+
["ddl-03", "DROP TABLE rolled back restores table and data"],
|
|
15
|
+
["ddl-04", "CREATE TABLE plus INSERT rolled back together"],
|
|
16
|
+
["sp-01", "ROLLBACK TO undoes work after the savepoint only"],
|
|
17
|
+
["sp-02", "RELEASE SAVEPOINT keeps later changes"],
|
|
18
|
+
["sp-03", "nested savepoints: rollback to outer discards inner work"],
|
|
19
|
+
["sp-04", "nested savepoints: rollback to inner keeps outer work"],
|
|
20
|
+
["sp-05", "savepoint name reuse shadows the older savepoint"],
|
|
21
|
+
["sp-06", "work continues normally after ROLLBACK TO"],
|
|
22
|
+
["rec-01", "savepoint recovers a unique violation"],
|
|
23
|
+
["rec-02", "savepoint recovers division by zero"],
|
|
24
|
+
["edge-01", "COMMIT outside a transaction is tolerated"],
|
|
25
|
+
["edge-02", "ROLLBACK outside a transaction is tolerated"],
|
|
26
|
+
["edge-03", "nested BEGIN keeps a single transaction"],
|
|
27
|
+
["edge-04", "SAVEPOINT outside a transaction fails"],
|
|
28
|
+
["edge-05", "ROLLBACK works after a failed statement in a txn"],
|
|
29
|
+
["forms-01", "START TRANSACTION and END forms"],
|
|
30
|
+
["forms-02", "BEGIN WORK and COMMIT WORK forms"],
|
|
31
|
+
[
|
|
32
|
+
"abort-01",
|
|
33
|
+
"aborted-transaction state (25P02) is not implemented",
|
|
34
|
+
D,
|
|
35
|
+
"memory keeps executing statements after a failure inside BEGIN; PostgreSQL rejects them with 25P02",
|
|
36
|
+
["tests/contract/_reports/session-system.md"],
|
|
37
|
+
"no-aborted-transaction-state",
|
|
38
|
+
],
|
|
39
|
+
]);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
const D = "documented_divergence" as const;
|
|
4
|
+
|
|
5
|
+
export const TYP_SECTION: CatalogSection = section("TYP", "Scalar type system & casts", true, [
|
|
6
|
+
["bool-01", "Boolean literals and pg_typeof"],
|
|
7
|
+
["bool-02", "Boolean text input forms"],
|
|
8
|
+
["bool-03", "Invalid boolean text errors"],
|
|
9
|
+
["int-01", "Integer literal typing int2/int4/int8"],
|
|
10
|
+
["int-02", "int2 overflow errors"],
|
|
11
|
+
["int-03", "int4 overflow errors"],
|
|
12
|
+
["int-04", "int8 arithmetic overflow errors"],
|
|
13
|
+
["int-05", "Integer extremes round-trip"],
|
|
14
|
+
["int-06", "int8 min divided by -1 overflows"],
|
|
15
|
+
["float-01", "float4/float8 casts and typing"],
|
|
16
|
+
["float-02", "NaN and Infinity text forms"],
|
|
17
|
+
["float-03", "NaN comparison ordering"],
|
|
18
|
+
[
|
|
19
|
+
"float-04",
|
|
20
|
+
"Float literal beyond float8 range",
|
|
21
|
+
D,
|
|
22
|
+
"memory saturates '1e400'::float8 to Infinity; PostgreSQL raises 22003 out of range",
|
|
23
|
+
undefined,
|
|
24
|
+
"float8-overflow-saturates",
|
|
25
|
+
],
|
|
26
|
+
["float-05", "float8 binary artifacts surface"],
|
|
27
|
+
["num-01", "Numeric literal typing and scale preservation"],
|
|
28
|
+
["num-02", "numeric(p,s) typmod rounding"],
|
|
29
|
+
["num-03", "Numeric field overflow errors"],
|
|
30
|
+
["num-04", "Numeric NaN"],
|
|
31
|
+
["num-05", "Numeric division result scale"],
|
|
32
|
+
["text-01", "varchar(n) insert overflow errors"],
|
|
33
|
+
["text-02", "varchar(n) cast truncates silently"],
|
|
34
|
+
["text-03", "char(n) blank padding"],
|
|
35
|
+
["text-04", "char(n) comparison ignores trailing blanks"],
|
|
36
|
+
["text-05", "char(n) cast truncation"],
|
|
37
|
+
["bytea-01", "Bytea hex round-trip"],
|
|
38
|
+
["bytea-02", "Text to bytea and back"],
|
|
39
|
+
["uuid-01", "UUID normalization to lowercase"],
|
|
40
|
+
["uuid-02", "Invalid UUID errors"],
|
|
41
|
+
["uuid-03", "Braced UUID input"],
|
|
42
|
+
["dt-01", "Date literal and typing"],
|
|
43
|
+
["dt-02", "Timestamp input forms"],
|
|
44
|
+
["dt-03", "timestamptz AT TIME ZONE"],
|
|
45
|
+
["dt-04", "Interval input forms including ISO 8601"],
|
|
46
|
+
["dt-05", "Out-of-range date errors"],
|
|
47
|
+
["unknown-01", "Unknown literal typing"],
|
|
48
|
+
["unknown-02", "Unknown literal resolved by column context"],
|
|
49
|
+
["pgt-01", "Arithmetic result types"],
|
|
50
|
+
["pgt-02", "Mixed-type promotion rules"],
|
|
51
|
+
["cast-01", "Invalid integer cast text errors"],
|
|
52
|
+
["cast-02", "Whitespace-tolerant integer parse"],
|
|
53
|
+
["cast-03", "numeric to int rounds half away from zero"],
|
|
54
|
+
["cast-04", "float8 to int rounds half to even"],
|
|
55
|
+
]);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
export const UNI_SECTION: CatalogSection = section("UNI", "Unicode, encoding, weird text", true, [
|
|
4
|
+
["utf-01", "multi-byte UTF-8 round-trip"],
|
|
5
|
+
["len-01", "length/char_length count characters"],
|
|
6
|
+
["octet-01", "octet_length counts UTF-8 bytes"],
|
|
7
|
+
["astral-01", "astral-plane length substr position"],
|
|
8
|
+
["nul-01", "chr(0) is rejected"],
|
|
9
|
+
["fold-01", "upper/lower on ASCII"],
|
|
10
|
+
["char-01", "chr/ascii round-trip"],
|
|
11
|
+
["hex-01", "encode(convert_to(...), 'hex') of multi-byte text"],
|
|
12
|
+
["esc-01", "E-string unicode escapes"],
|
|
13
|
+
]);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type CatalogSection, section } from "../scenario-types.ts";
|
|
2
|
+
|
|
3
|
+
export const WIN_SECTION: CatalogSection = section("WIN", "Window functions", true, [
|
|
4
|
+
["rank-01", "row_number over ORDER BY"],
|
|
5
|
+
["rank-02", "row_number partitioned"],
|
|
6
|
+
["rank-03", "rank with ties and gaps"],
|
|
7
|
+
["rank-04", "dense_rank without gaps"],
|
|
8
|
+
["rank-05", "percent_rank and cume_dist"],
|
|
9
|
+
["rank-06", "ntile even and uneven buckets"],
|
|
10
|
+
["rank-07", "empty OVER clause"],
|
|
11
|
+
["nav-01", "lag and lead defaults"],
|
|
12
|
+
["nav-02", "lag lead with offsets and default values"],
|
|
13
|
+
["nav-03", "lag lead reset at partition boundaries"],
|
|
14
|
+
["nav-04", "first_value"],
|
|
15
|
+
["nav-05", "last_value default frame vs full frame"],
|
|
16
|
+
["nav-06", "nth_value incl beyond partition"],
|
|
17
|
+
["nav-07", "navigation over non-int types"],
|
|
18
|
+
["aggw-01", "sum as running-total window"],
|
|
19
|
+
["aggw-02", "avg and count over partitions"],
|
|
20
|
+
["aggw-03", "min max as running windows"],
|
|
21
|
+
["aggw-04", "string_agg and array_agg as windows"],
|
|
22
|
+
["aggw-05", "FILTER on window aggregates"],
|
|
23
|
+
["frame-01", "ROWS BETWEEN preceding and current"],
|
|
24
|
+
["frame-02", "ROWS following and shorthand frames"],
|
|
25
|
+
["frame-03", "ROWS unbounded both directions"],
|
|
26
|
+
["frame-04", "centered moving average"],
|
|
27
|
+
["frame-05", "RANGE default includes peers"],
|
|
28
|
+
["frame-06", "RANGE with numeric offsets"],
|
|
29
|
+
["frame-07", "RANGE with interval offsets over dates"],
|
|
30
|
+
["frame-08", "GROUPS frames"],
|
|
31
|
+
["frame-09", "EXCLUDE CURRENT ROW"],
|
|
32
|
+
["frame-10", "EXCLUDE GROUP and EXCLUDE TIES"],
|
|
33
|
+
["frame-11", "EXCLUDE NO OTHERS explicit"],
|
|
34
|
+
["named-01", "named window reused by two functions"],
|
|
35
|
+
["named-02", "named window with PARTITION BY"],
|
|
36
|
+
["named-03", "named window refined with a frame"],
|
|
37
|
+
["named-04", "multiple named windows in one query"],
|
|
38
|
+
["multi-01", "multiple window functions in one SELECT"],
|
|
39
|
+
["multi-02", "window function in ORDER BY clause"],
|
|
40
|
+
["mix-01", "windows over GROUP BY aggregates"],
|
|
41
|
+
["mix-02", "window in subquery filtered outside"],
|
|
42
|
+
["err-01", "undefined named window errors"],
|
|
43
|
+
]);
|