import type { ConnectionTag } from '../../utils/common' import type { ResultCallback } from '../../utils/fp/Result' import type { RecordId } from '../../Model' import type { SerializedQuery } from '../../Query' import type { TableName, AppSchema, SchemaVersion } from '../../Schema' import type { SchemaMigrations, MigrationStep } from '../../Schema/migrations' import type { DatabaseAdapter, CachedQueryResult, CachedFindResult, BatchOperation, UnsafeExecuteOperations, } from '../type' import type { DispatcherType, SQL, SQLiteAdapterOptions, SQLiteArg, SQLiteQuery, SqliteDispatcher, MigrationEvents, } from './type' import { $Shape } from '../../types' export type { SQL, SQLiteArg, SQLiteQuery } export default class SQLiteAdapter implements DatabaseAdapter { static adapterType: string schema: AppSchema migrations?: SchemaMigrations _migrationEvents?: MigrationEvents _tag: ConnectionTag dbName: string _dispatcherType: DispatcherType _dispatcher: SqliteDispatcher _initPromise: Promise constructor(options: SQLiteAdapterOptions) get initializingPromise(): Promise testClone(options?: $Shape): Promise _getName(name?: string): string _init(callback: ResultCallback): void _setUpWithMigrations(databaseVersion: SchemaVersion, callback: ResultCallback): void _setUpWithSchema(callback: ResultCallback): void find(table: TableName, id: RecordId, callback: ResultCallback): void query(query: SerializedQuery, callback: ResultCallback): void queryIds(query: SerializedQuery, callback: ResultCallback): void unsafeQueryRaw(query: SerializedQuery, callback: ResultCallback): void count(query: SerializedQuery, callback: ResultCallback): void batch(operations: BatchOperation[], callback: ResultCallback): void getDeletedRecords(table: TableName, callback: ResultCallback): void destroyDeletedRecords( table: TableName, recordIds: RecordId[], callback: ResultCallback, ): void unsafeLoadFromSync(jsonId: number, callback: ResultCallback): void provideSyncJson(id: number, syncPullResultJson: string, callback: ResultCallback): void unsafeResetDatabase(callback: ResultCallback): void unsafeExecute(operations: UnsafeExecuteOperations, callback: ResultCallback): void getLocal(key: string, callback: ResultCallback): void setLocal(key: string, value: string, callback: ResultCallback): void removeLocal(key: string, callback: ResultCallback): void _encodedSchema(): SQL _migrationSteps(fromVersion: SchemaVersion): MigrationStep[] | undefined }