@crvouga/mockingbird-service-postgres 3.6.0 → 3.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.
@@ -90,6 +90,10 @@ export interface TriggerMeta {
90
90
  timing: "before" | "after" | "instead_of";
91
91
  events: CreateTriggerStmt["events"];
92
92
  forEachRow: boolean;
93
+ /** `REFERENCING OLD TABLE AS …` name; only on AFTER statement triggers for UPDATE or DELETE */
94
+ oldTable?: string;
95
+ /** `REFERENCING NEW TABLE AS …` name; only on AFTER statement triggers for INSERT or UPDATE */
96
+ newTable?: string;
93
97
  when: Expr | null;
94
98
  funcSchema: string;
95
99
  funcName: string;
@@ -100,6 +104,8 @@ export declare class TableData {
100
104
  schema: string;
101
105
  columns: ColumnMeta[];
102
106
  rows: Datum[][];
107
+ rowXmins: WeakMap<Datum[], number>;
108
+ slabXmins: number[] | null;
103
109
  /** Frozen columnar storage after snapshot hydrate; `rows` stays empty until materialized. */
104
110
  slab: ColumnarSlab | null;
105
111
  constraints: ConstraintMeta[];
@@ -189,6 +195,7 @@ export interface DomainData {
189
195
  shareCount?: number;
190
196
  }
191
197
  export interface FunctionData {
198
+ settings?: Record<string, string>;
192
199
  name: string;
193
200
  schema: string;
194
201
  argNames: (string | null)[];
@@ -262,6 +269,10 @@ export declare class DatabaseState {
262
269
  clock: Clock;
263
270
  changes: number;
264
271
  private oidCounter;
272
+ /** Local monotonic xid allocator; 2 denotes a row from a legacy snapshot without metadata. */
273
+ xidCounter: number;
274
+ transactionXid: number | null;
275
+ allocateXid(): number;
265
276
  inTransaction: boolean;
266
277
  /** Transaction-only events: included in rollback clones, never in exported snapshots. */
267
278
  pendingTriggers: Array<{
@@ -19,5 +19,10 @@ export declare function parseNamespaceInput(text: string): {
19
19
  } | {
20
20
  name: string;
21
21
  };
22
+ export declare function parseRelationInput(text: string): {
23
+ oid: number;
24
+ } | {
25
+ parts: string[];
26
+ };
22
27
  /** regnamespaceout: `-` for zero, the quoted schema name, or the bare number when no schema has that oid. */
23
28
  export declare function namespaceText(oid: number, name: string | null | undefined): string;
@@ -82,6 +82,7 @@ export declare function moneyText(cents: bigint): string;
82
82
  export interface OutputCtx {
83
83
  /** unquoted schema name for an oid, or null when no schema has it */
84
84
  namespaceName?(oid: number): string | null;
85
+ relationName?(oid: number): string | null;
85
86
  /** offset seconds east of UTC for rendering timestamptz at given UTC micros */
86
87
  zoneOffsetAt(utcMicros: bigint): number;
87
88
  }
@@ -93,6 +94,7 @@ export declare function datumText(t: TypeId, v: Datum, ctx: OutputCtx): string;
93
94
  export interface InputCtx {
94
95
  /** oid of the schema with exactly this name; raises 3F000 when there is none */
95
96
  namespaceOid?(name: string): number;
97
+ relationOid?(parts: string[]): number;
96
98
  /** session zone offset lookup for naive timestamptz input */
97
99
  zoneOffsetForNaive(naiveMicros: bigint): number;
98
100
  /** enum label validation: returns true when label is valid for the enum type */