phase-10.5: market screener ui enhancements
This commit is contained in:
@@ -139,6 +139,24 @@ export class DatabaseConnection {
|
||||
return txn();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a raw SQL SELECT and return the first row.
|
||||
* Use only when QueryBuilder is not practical (e.g. auth domain with static queries).
|
||||
*/
|
||||
rawGet<T = Record<string, unknown>>(sql: string, params: unknown[] = []): T | undefined {
|
||||
const stmt = this.getOrCacheStatement(sql);
|
||||
return stmt.get(...params) as T | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a raw SQL INSERT/UPDATE/DELETE.
|
||||
* Use only when QueryBuilder is not practical (e.g. auth domain with static queries).
|
||||
*/
|
||||
rawRun(sql: string, params: unknown[] = []): number {
|
||||
const stmt = this.getOrCacheStatement(sql);
|
||||
return stmt.run(...params).changes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the raw better-sqlite3 Db instance (for advanced use only).
|
||||
* Prefer the DatabaseConnection methods.
|
||||
|
||||
Reference in New Issue
Block a user