@crvouga/mockingbird-service-postgres 3.11.0 → 3.12.1

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.
@@ -3,12 +3,19 @@ export declare class IndexStore {
3
3
  readonly name: string;
4
4
  readonly unique: boolean;
5
5
  private entries;
6
+ private integerKeys;
7
+ private shared;
8
+ private ownedBuckets;
9
+ private writableBucket;
10
+ private detach;
6
11
  constructor(name: string, unique?: boolean);
7
12
  get size(): number;
8
13
  checkUnique(key: string, rowIdx?: number): void;
9
14
  insert(key: string, rowIdx: number): void;
10
15
  remove(key: string, rowIdx: number): void;
11
16
  lookup(key: string): readonly number[];
17
+ /** Ordered access for a single int2/int4 key (the planner validates the key type). */
18
+ integerRange(lower: number, upper: number, includeLower: boolean, includeUpper: boolean): number[];
12
19
  clear(): void;
13
20
  clone(): IndexStore;
14
21
  }
@@ -4,6 +4,8 @@ import type { TableData } from "../storage/database-state.js";
4
4
  import type { Datum } from "../types/value.js";
5
5
  import { IndexStore } from "./index.js";
6
6
  export declare function invalidateTableIndexes(table: TableData): void;
7
+ /** Retain pure derived indexes in the frozen source so rollback need not rebuild them. */
8
+ export declare function prepareDmlIndexStores(env: ExecEnv, table: TableData): void;
7
9
  export declare function indexStoreFor(env: ExecEnv, table: TableData, spec: UniqueSpec): IndexStore;
8
10
  export declare function indexInsertRow(env: ExecEnv, table: TableData, rowIdx: number, row: Datum[]): void;
9
11
  export declare function indexRemoveRow(env: ExecEnv, table: TableData, rowIdx: number, row: Datum[]): void;
@@ -8,6 +8,21 @@ export interface ConstEquality {
8
8
  }
9
9
  export declare function equalityAgainstConst(expr: Expr): ConstEquality | null;
10
10
  export declare function conjunctions(expr: Expr): Expr[];
11
+ /**
12
+ * Conservative point access for DML and allocation-free SELECT sources. No casts, volatile
13
+ * expressions or partial/expression indexes: unsupported shapes retain the existing executor.
14
+ * Index statistics are left to the caller (DML historically does not increment SELECT scans).
15
+ */
16
+ export declare function tryPointRowIndices(env: ExecEnv, table: TableData, alias: string, where: Expr): {
17
+ indices: readonly number[];
18
+ indexName: string;
19
+ } | null;
20
+ export declare function recordIndexScan(env: ExecEnv, table: TableData, name: string): void;
21
+ /** Bounded integer ranges; all other expressions retain their existing execution order. */
22
+ export declare function tryRangeRowIndices(env: ExecEnv, table: TableData, alias: string, where: Expr): {
23
+ indices: readonly number[];
24
+ indexName: string;
25
+ } | null;
11
26
  /** Single-table PK / unique equality lookup: returns matching rows or null to scan. */
12
27
  export declare function tryIndexedTableRows(env: ExecEnv, table: TableData, alias: string, where: Expr): Datum[][] | null;
13
28
  export declare function tryIndexedFromItem(env: ExecEnv, item: FromItem, where: Expr | null): Datum[][] | null;
@@ -16,8 +16,12 @@ export declare class Writer {
16
16
  i32(value: number): void;
17
17
  u64(value: bigint): void;
18
18
  i64(value: bigint): void;
19
+ /** Finite integer Number, encoded identically to i64(BigInt(value)) without allocation. */
20
+ i64Number(value: number): void;
19
21
  f64(value: number): void;
20
22
  raw(value: Uint8Array): void;
23
+ /** Reserve one contiguous region. Fill it before any subsequent Writer call can grow the buffer. */
24
+ block(byteLength: number): DataView;
21
25
  /** Length-prefixed UTF-8. */
22
26
  text(value: string): void;
23
27
  /** Write UTF-8 at current position without length prefix (intern blob region). */