@crvouga/mockingbird-service-postgres 3.5.0 → 3.7.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.
@@ -83,6 +83,9 @@ export interface IndexMeta {
83
83
  isConstraint: boolean;
84
84
  }
85
85
  export interface TriggerMeta {
86
+ constraint?: boolean;
87
+ deferrable?: boolean;
88
+ initiallyDeferred?: boolean;
86
89
  name: string;
87
90
  timing: "before" | "after" | "instead_of";
88
91
  events: CreateTriggerStmt["events"];
@@ -97,6 +100,8 @@ export declare class TableData {
97
100
  schema: string;
98
101
  columns: ColumnMeta[];
99
102
  rows: Datum[][];
103
+ rowXmins: WeakMap<Datum[], number>;
104
+ slabXmins: number[] | null;
100
105
  /** Frozen columnar storage after snapshot hydrate; `rows` stays empty until materialized. */
101
106
  slab: ColumnarSlab | null;
102
107
  constraints: ConstraintMeta[];
@@ -186,6 +191,7 @@ export interface DomainData {
186
191
  shareCount?: number;
187
192
  }
188
193
  export interface FunctionData {
194
+ settings?: Record<string, string>;
189
195
  name: string;
190
196
  schema: string;
191
197
  argNames: (string | null)[];
@@ -259,7 +265,21 @@ export declare class DatabaseState {
259
265
  clock: Clock;
260
266
  changes: number;
261
267
  private oidCounter;
268
+ /** Local monotonic xid allocator; 2 denotes a row from a legacy snapshot without metadata. */
269
+ xidCounter: number;
270
+ transactionXid: number | null;
271
+ allocateXid(): number;
262
272
  inTransaction: boolean;
273
+ /** Transaction-only events: included in rollback clones, never in exported snapshots. */
274
+ pendingTriggers: Array<{
275
+ schema: string;
276
+ table: string;
277
+ trigger: string;
278
+ event: "insert" | "update" | "delete";
279
+ oldRow: Datum[] | null;
280
+ newRow: Datum[] | null;
281
+ }>;
282
+ constraintModes: Map<string, boolean>;
263
283
  /** most recent sequence touched by nextval/setval, for lastval() */
264
284
  lastSequence: {
265
285
  schema: string;
@@ -0,0 +1,2 @@
1
+ /** In-memory placement supports the database default and the built-in heap AM. */
2
+ export declare function validateStorageSetting(name: string, value: string): void;
@@ -0,0 +1,3 @@
1
+ import { TableData, type ViewData } from "./database-state.js";
2
+ /** Materialized views share index validation/catalog rules with stored tables. */
3
+ export declare function materializedTable(view: ViewData): TableData;
@@ -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 */