Readonly
classProtected
liftsProtected
resolverProtected
sessionOptional
setStatic
Readonly
onStatic
Readonly
onStatic
Readonly
onStatic
Readonly
onStatic
Readonly
onOptional
as: ASProtected
callClear all filter conditions.
Protected
createProtected
deleteWhen fetching objects from the database, for each object will a snapshot be generated, on which change-detection happens. This behavior is not necessary when only fetching data and never modifying its objects (when for example returning data to the client directly). When this is the case, you can disable change-detection entirely for the returned objects. Note: Persisting/committing (database.persist(), session.commit) won't detect any changes when change-detection is disabled.
Identity mapping is used to store all created entity instances in a pool. If a query fetches an already known entity instance, the old will be picked. This ensures object instances uniqueness and generally saves CPU circles.
This disabled entity tracking, forcing always to create new entity instances.
For queries created on the database object (database.query(T)), this is disabled per default. Only on sessions (const session = database.createSession(); session.query(T)) is the identity map enabled per default, and can be disabled with this method.
Narrow the query result.
Note: previous filter conditions are preserved.
Optional
filter: FilterQuery<T>Narrow the query result by field-specific conditions.
This can be helpful to work around the type issue that when T
is another
generic type there must be a type assertion to use filter.
Note: previous filter conditions are preserved.
For MySQL/Postgres SELECT FOR SHARE. Has no effect in SQLite/MongoDB.
For MySQL/Postgres SELECT FOR UPDATE. Has no effect in SQLite/MongoDB.
Rest
...field: KOptional
filter: FilterQuery<T>Adds a inner join in the filter. Does NOT populate the reference with values.
Accessing field
in the entity (if not optional field) results in an error.
Adds a inner join in the filter and populates the result set WITH reference field accordingly.
Includes only soft deleted records.
Sets the page size when page(x)
is used.
Adds a left join in the filter. Does NOT populate the reference with values.
Accessing field
in the entity (if not optional field) results in an error.
Adds a left join in the filter and populates the result set WITH reference field accordingly.
Optional
value: numberProtected
onApplies limit/skip operations correctly to basically have a paging functionality. Make sure to call itemsPerPage() before you call page.
Protected
patchRest
...fields: FieldName<T>[]Rest
...select: KOptional
value: numberOptional
sort: Sort<T, any>Adds a inner join in the filter. Does NOT populate the reference with values.
Accessing field
in the entity (if not optional field) results in an error.
Returns JoinDatabaseQuery to further specify the join, which you need to .end()
Adds a inner join in the filter and populates the result set WITH reference field accordingly.
Returns JoinDatabaseQuery to further specify the join, which you need to .end()
Adds a left join in the filter. Does NOT populate the reference with values.
Accessing field
in the entity (if not optional field) results in an error.
Returns JoinDatabaseQuery to further specify the join, which you need to .end()
Adds a left join in the filter and populates the result set WITH reference field accordingly.
Returns JoinDatabaseQuery to further specify the join, which you need to .end()
Optional
as: ASOptional
as: ASOptional
as: ASOptional
as: ASOptional
as: ASEnables fetching, updating, and deleting of soft-deleted records.
Optional
as: ASStatic
fromStatic
isGenerated using TypeDoc
This a generic query abstraction which should supports most basics database interactions.
All query implementations should extend this since db agnostic consumers are probably coded against this interface via Database which uses this GenericQuery.