AK-21/Graphite-Industrial-Intelligence
0
1import type { SQLiteDatabase, SQLiteRunResult, SQLiteStatement } from 'expo-sqlite';2import { entityKind } from "../entity.js";3import type { Logger } from "../logger.js";4import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.js";5import { type Query } from "../sql/sql.js";6import type { SQLiteSyncDialect } from "../sqlite-core/dialect.js";7import { SQLiteTransaction } from "../sqlite-core/index.js";8import type { SelectedFieldsOrdered } from "../sqlite-core/query-builders/select.types.js";9import { type PreparedQueryConfig as PreparedQueryConfigBase, type SQLiteExecuteMethod, SQLitePreparedQuery, SQLiteSession, type SQLiteTransactionConfig } from "../sqlite-core/session.js";10export interface ExpoSQLiteSessionOptions {11 logger?: Logger;12}13type PreparedQueryConfig = Omit<PreparedQueryConfigBase, 'statement' | 'run'>;14export declare class ExpoSQLiteSession<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends SQLiteSession<'sync', SQLiteRunResult, TFullSchema, TSchema> {15 private client;16 private schema;17 static readonly [entityKind]: string;18 private logger;19 constructor(client: SQLiteDatabase, dialect: SQLiteSyncDialect, schema: RelationalSchemaConfig<TSchema> | undefined, options?: ExpoSQLiteSessionOptions);20 prepareQuery<T extends Omit<PreparedQueryConfig, 'run'>>(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, isResponseInArrayMode: boolean, customResultMapper?: (rows: unknown[][]) => unknown): ExpoSQLitePreparedQuery<T>;21 transaction<T>(transaction: (tx: ExpoSQLiteTransaction<TFullSchema, TSchema>) => T, config?: SQLiteTransactionConfig): T;22}23export declare class ExpoSQLiteTransaction<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends SQLiteTransaction<'sync', SQLiteRunResult, TFullSchema, TSchema> {24 static readonly [entityKind]: string;25 transaction<T>(transaction: (tx: ExpoSQLiteTransaction<TFullSchema, TSchema>) => T): T;26}27export declare class ExpoSQLitePreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig> extends SQLitePreparedQuery<{28 type: 'sync';29 run: SQLiteRunResult;30 all: T['all'];31 get: T['get'];32 values: T['values'];33 execute: T['execute'];34}> {35 private stmt;36 private logger;37 private fields;38 private _isResponseInArrayMode;39 private customResultMapper?;40 static readonly [entityKind]: string;41 constructor(stmt: SQLiteStatement, query: Query, logger: Logger, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, _isResponseInArrayMode: boolean, customResultMapper?: ((rows: unknown[][]) => unknown) | undefined);42 run(placeholderValues?: Record<string, unknown>): SQLiteRunResult;43 all(placeholderValues?: Record<string, unknown>): T['all'];44 get(placeholderValues?: Record<string, unknown>): T['get'];45 values(placeholderValues?: Record<string, unknown>): T['values'];46}47export {};48 