mirror of
https://github.com/djhackersdev/minime.git
synced 2026-08-23 19:04:20 -05:00
sql: Add raw SQL interface method
This commit is contained in:
@@ -12,6 +12,8 @@ export interface Transaction {
|
||||
fetchRow(stmt: sql.SelectStatement): Promise<Row | undefined>;
|
||||
|
||||
fetchRows(stmt: sql.SelectStatement): Promise<Row[]>;
|
||||
|
||||
raw(sql: string): Promise<void>;
|
||||
}
|
||||
|
||||
export interface DataSource {
|
||||
|
||||
@@ -75,6 +75,12 @@ class SqliteTransaction implements Transaction {
|
||||
|
||||
return Promise.resolve(result);
|
||||
}
|
||||
|
||||
raw(sql: string): Promise<void> {
|
||||
this._db.exec(sql);
|
||||
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
class SqliteDataSource implements DataSource {
|
||||
|
||||
Reference in New Issue
Block a user