28 lines
813 B
TypeScript
28 lines
813 B
TypeScript
/// The MIT License (MIT)
|
|
/// Copyright (c) 2023 Alex Gleason
|
|
/// Copyright (c) 2022 Sami Koskimäki
|
|
/// https://gitlab.com/soapbox-pub/kysely-deno-sqlite
|
|
|
|
import type { SqliteDialectConfig } from 'kysely';
|
|
|
|
/** Type compatible with both [dyedgreen/deno-sqlite](https://github.com/dyedgreen/deno-sqlite) and [denodrivers/sqlite3](https://github.com/denodrivers/sqlite3). */
|
|
type DenoSqlite =
|
|
& {
|
|
close(): void;
|
|
changes: number;
|
|
lastInsertRowId: number;
|
|
}
|
|
& ({
|
|
queryEntries(sql: string, params: any): unknown[];
|
|
} | {
|
|
prepare(sql: string): {
|
|
all(...params: any): unknown[];
|
|
};
|
|
});
|
|
|
|
interface DenoSqliteDialectConfig extends Omit<SqliteDialectConfig, 'database'> {
|
|
database: DenoSqlite | (() => Promise<DenoSqlite>);
|
|
}
|
|
|
|
export type { DenoSqlite, DenoSqliteDialectConfig };
|