Skip to main content

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

ParameterTypeDescription
optionsQueryOptionsThe 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

ParameterTypeDescription
stringsTemplateStringsArrayThe SQL query template string.
...valuesreadonly 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();

Defined in

packages/verse-core/src/verse.ts:166