Type Alias: RootQueryOperations<TQueryable>
RootQueryOperations<
TQueryable
>: {options
:TQueryable
;sql
:TQueryable
; }
Type Parameters
Type Parameter |
---|
TQueryable |
Type declaration
options()
Set query options that affect the behaviour of the query.
Parameters
Parameter | Type | Description |
---|---|---|
options | QueryOptions | The query options. |
Returns
TQueryable
The queryable with the specified options applied.
Example
const q =
db.from.albums.options({ disabledConditions: ["soft delete"] });
sql()
Inject a raw SQL query using tagged template literals. The returned queryable may be further composed with additional query operators.
Parameters
Parameter | Type | Description |
---|---|---|
strings | TemplateStringsArray | The SQL query template string. |
...values | readonly any [] | The values to be inserted into the query. |
Returns
TQueryable
The queryable result of the injected SQL query.
Example
const id = 1;
const album =
db.from.albums
.sql`select * from "Album" where "AlbumId" = ${id}`.single();