SqlClient
View as MarkdownDefined in: hub/src/store/sql.ts:24
The slice of a Postgres client the SQL store needs (PGlite and node-postgres both fit).
Extends
Section titled “Extends”Methods
Section titled “Methods”query()
Section titled “query()”query<T>(sql, params?): Promise<{ rows: T[];}>;Defined in: hub/src/store/sql.ts:22
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
sql |
string |
params? |
unknown[] |
Returns
Section titled “Returns”Promise<{
rows: T[];
}>
Inherited from
Section titled “Inherited from”transaction()
Section titled “transaction()”transaction<T>(fn): Promise<T>;Defined in: hub/src/store/sql.ts:26
Runs fn in a transaction; a throw rolls it back.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
fn |
(tx) => Promise<T> |
Returns
Section titled “Returns”Promise<T>