Transaction
Extends
Properties
Property | Type | Description | Inherited from |
---|---|---|---|
commit | () => Promise < QueryResult > | Commit multiple changes to the local DB using the Transaction context. | - |
execute | (query : string , params ?: any []) => Promise < QueryResult > | Execute a single write statement. | LockContext .execute |
rollback | () => Promise < QueryResult > | Roll back multiple attempted changes using the Transaction context. | - |
Methods
get()
get<
T
>(sql
,parameters
?):Promise
<T
>
Execute a read-only query and return the first result, error if the ResultSet is empty.
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
sql | string |
parameters ? | any [] |
Returns
Promise
< T
>
Inherited from
Source
packages/common/lib/db/DBAdapter.d.ts:37
getAll()
getAll<
T
>(sql
,parameters
?):Promise
<T
[] >
Execute a read-only query and return results.
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
sql | string |
parameters ? | any [] |
Returns
Promise
< T
[] >
Inherited from
Source
packages/common/lib/db/DBAdapter.d.ts:33
getOptional()
getOptional<
T
>(sql
,parameters
?):Promise
<null
|T
>
Execute a read-only query and return the first result, or null if the ResultSet is empty.
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
sql | string |
parameters ? | any [] |
Returns
Promise
< null
| T
>
Inherited from
Source
packages/common/lib/db/DBAdapter.d.ts:35