pg-mem
Version:
A memory version of postgres
31 lines • 1.4 kB
TypeScript
import { _IIndex, IValue, _ITable, _Transaction, _Explainer, _IndexExplanation, IndexOp, IndexKey, Stats, Row } from '../interfaces-private';
interface IndexSubject {
readonly size: number;
readonly column: IValue;
byColumnValue(columnValue: string, t: _Transaction): Row[];
}
export declare class CustomIndex implements _IIndex {
readonly onTable: _ITable;
private subject;
readonly expressions: IValue[];
explain(e: _Explainer): _IndexExplanation;
constructor(onTable: _ITable, subject: IndexSubject);
get indexName(): string;
entropy(): number;
stats(t: _Transaction, key?: IndexKey): Stats | null;
iterateKeys(): null;
add(raw: any): void;
eqFirst([key]: any, t: _Transaction): any;
enumerate(op: IndexOp): Iterable<Row>;
eq([rawKey]: any, t: _Transaction): Iterable<any>;
nin(keys: any[][], t: _Transaction): Generator<any, void, unknown>;
neq([rawKey]: any, t: _Transaction): Generator<any, void, unknown>;
gt(rawKey: any, t: _Transaction): Iterable<any>;
lt(rawKey: any, t: _Transaction): Iterable<any>;
ge(rawKey: any, t: _Transaction): Iterable<any>;
le(rawKey: any, t: _Transaction): Iterable<any>;
outside(lo: IndexKey, hi: IndexKey, t: _Transaction): Iterable<Row>;
inside(lo: IndexKey, hi: IndexKey, t: _Transaction): Iterable<Row>;
}
export {};
//# sourceMappingURL=custom-index.d.ts.map