pg-mem
Version:
A memory version of postgres
26 lines • 1.43 kB
TypeScript
import { _ISchema, _ISelection, _IDb, OnStatementExecuted, nil, _IStatement, IValue, Parameter, _IType } from '../interfaces-private';
export interface INameResolver {
/** Try to resolve a name */
resolve(name: string): IValue | nil;
/** True if is isolated... meaning that one cannot fetch values from its parent */
readonly isolated: boolean;
}
interface IBuildContext {
readonly selection: _ISelection;
readonly db: _IDb;
readonly schema: _ISchema;
readonly onFinishExecution: (callback: OnStatementExecuted) => void;
readonly getTempBinding: (name: string) => _ISelection | nil;
readonly setTempBinding: (name: string, boundTo: _ISelection) => void;
readonly getParameter: (nameOrPosition: string | number) => IValue | nil;
readonly setParameterType: (nameOrPosition: number, type: _IType) => void;
}
export declare function buildCtx(): IBuildContext;
export declare const withSelection: <ret>(value: _ISelection, act: () => ret) => ret;
export declare const withStatement: <ret>(value: _IStatement, act: () => ret) => ret;
export declare function withBindingScope<T>(act: () => T): T;
export declare const withParameters: <ret>(value: Parameter[], act: () => ret) => ret;
export declare const withNameResolver: <ret>(value: INameResolver, act: () => ret) => ret;
export declare function resolveName(name: string): IValue | null;
export {};
//# sourceMappingURL=context.d.ts.map