CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
session.d.ts47 linesDownload Raw Back to durable-sqlite
1import { entityKind } from "../entity.js";2import type { Logger } from "../logger.js";3import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.js";4import { type Query } from "../sql/sql.js";5import { type SQLiteSyncDialect, SQLiteTransaction } from "../sqlite-core/index.js";6import type { SelectedFieldsOrdered } from "../sqlite-core/query-builders/select.types.js";7import { type PreparedQueryConfig as PreparedQueryConfigBase, type SQLiteExecuteMethod, SQLiteSession, type SQLiteTransactionConfig } from "../sqlite-core/session.js";8import { SQLitePreparedQuery as PreparedQueryBase } from "../sqlite-core/session.js";9export interface SQLiteDOSessionOptions {10    logger?: Logger;11}12type PreparedQueryConfig = Omit<PreparedQueryConfigBase, 'statement' | 'run'>;13export declare class SQLiteDOSession<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends SQLiteSession<'sync', SqlStorageCursor<Record<string, SqlStorageValue>>, TFullSchema, TSchema> {14    private client;15    private schema;16    static readonly [entityKind]: string;17    private logger;18    constructor(client: DurableObjectStorage, dialect: SQLiteSyncDialect, schema: RelationalSchemaConfig<TSchema> | undefined, options?: SQLiteDOSessionOptions);19    prepareQuery<T extends Omit<PreparedQueryConfig, 'run'>>(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][]) => unknown): SQLiteDOPreparedQuery<T>;20    transaction<T>(transaction: (tx: SQLiteTransaction<'sync', SqlStorageCursor<Record<string, SqlStorageValue>>, TFullSchema, TSchema>) => T, _config?: SQLiteTransactionConfig): T;21}22export declare class SQLiteDOTransaction<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends SQLiteTransaction<'sync', SqlStorageCursor<Record<string, SqlStorageValue>>, TFullSchema, TSchema> {23    static readonly [entityKind]: string;24    transaction<T>(transaction: (tx: SQLiteDOTransaction<TFullSchema, TSchema>) => T): T;25}26export declare class SQLiteDOPreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig> extends PreparedQueryBase<{27    type: 'sync';28    run: void;29    all: T['all'];30    get: T['get'];31    values: T['values'];32    execute: T['execute'];33}> {34    private client;35    private logger;36    private fields;37    private _isResponseInArrayMode;38    private customResultMapper?;39    static readonly [entityKind]: string;40    constructor(client: DurableObjectStorage, query: Query, logger: Logger, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, _isResponseInArrayMode: boolean, customResultMapper?: ((rows: unknown[][]) => unknown) | undefined);41    run(placeholderValues?: Record<string, unknown>): void;42    all(placeholderValues?: Record<string, unknown>): T['all'];43    get(placeholderValues?: Record<string, unknown>): T['get'];44    values(placeholderValues?: Record<string, unknown>): T['values'];45}46export {};47