-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from JoinTheAlliance/sqljs
Add Sqljs adapter
- Loading branch information
Showing
10 changed files
with
704 additions
and
41 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
interface RunResult { | ||
changes: number; | ||
lastInsertRowid: number | bigint; | ||
} | ||
interface Statement<BindParameters extends unknown[]> { | ||
database: Database; | ||
source: string; | ||
reader: boolean; | ||
readonly: boolean; | ||
busy: boolean; | ||
|
||
run(...params: BindParameters): RunResult; | ||
get(...params: BindParameters): unknown; | ||
all(...params: BindParameters): unknown[]; | ||
iterate(...params: BindParameters): IterableIterator<unknown>; | ||
pluck(toggleState?: boolean): this; | ||
expand(toggleState?: boolean): this; | ||
raw(toggleState?: boolean): this; | ||
bind(...params: BindParameters): this; | ||
columns(): ColumnDefinition[]; | ||
safeIntegers(toggleState?: boolean): this; | ||
} | ||
interface ColumnDefinition { | ||
name: string; | ||
column: string | null; | ||
table: string | null; | ||
database: string | null; | ||
type: string | null; | ||
} | ||
|
||
export interface Database { | ||
memory: boolean; | ||
readonly: boolean; | ||
name: string; | ||
open: boolean; | ||
inTransaction: boolean; | ||
|
||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
prepare<BindParameters extends unknown[] | {} = unknown[]>( | ||
source: string, | ||
): BindParameters extends unknown[] | ||
? Statement<BindParameters> | ||
: Statement<[BindParameters]>; | ||
exec(source: string): this; | ||
[key: string]: unknown; | ||
} |
Oops, something went wrong.