Readonly Internal[Type-only fluent return constructor.
Readonly Internal[Type-only ordered argument contract.
Readonly Internal[Nominal identity for typed child-query customizers.
ReadonlyrowRuntime union matching decoded results, including selected variant bodies.
ReadonlyvariantStable object schemas keyed by discriminator, suitable for mapper.configure().
Internal
Shared parameter plan across union branches and included relations.
Explicit AND spelling of where(), including groups and typed parameters.
Explicit AND spelling of where(), including groups and typed parameters.
Explicit AND spelling of where(), including groups and typed parameters.
Explicit AND spelling of where(), including groups and typed parameters.
Configure a captured union SELECT and declare its complete raw output shape.
Internal
Compile one UNION ALL statement; JSON preserves distinct branch shapes.
Optionalcorrelate: ReadCorrelationOptionalmode: typeof COMPILE_PARAMETERSCount matching rows across variants, excluding global pagination and ordering.
Internal
Decode using exactly the selected branch's schema and codecs.
Optionalpath: stringDelete matching entities, honoring base-schema soft deletion and hooks.
Execute and decode one statement containing every requested branch.
Look up a single row by PK, typed to this variant.
Look up multiple rows by PK, typed to this variant.
Like find but throws EntityNotFoundError when absent.
Return the first globally ordered row, or undefined.
Customize a variant's typed read query, including nested relations. Return the configured query; other branches and their schemas are unchanged.
Permanently delete matching entities, including both CTI rows.
Load a common relation on every branch, configuring the child exactly once.
Optionalcustomize: (Customize a relation on one discriminator branch.
Optionalcustomize: (Insert a new variant row. The discriminator is set automatically.
For CTI: inserts the base row first, then the variant row (transactional).
Internal
Capture native primary keys for a single writable ORM variant.
Add an OR comparison or parenthesized group.
Add an OR comparison or parenthesized group.
Add an OR comparison or parenthesized group.
Add an OR comparison or parenthesized group.
Globally paginate the discriminated union, leaving the source and its metadata unchanged.
Read a property common to the selected variants; returned scalar values are detached.
Quote a mapped column for trusted raw SQL or correlated subqueries.
Restore matching soft-deleted entities; select them with onlyDeleted/withDeleted.
Internal
Check the identity of the original read source, retained by clones.
Select trusted SQL from the union envelope with an explicit output contract.
Restrict returned discriminator branches and narrow both runtime and inferred schemas.
Awaiting deliberately executes the query each time.
Optionalresolve: Optionalreject: ((error: any) => E | PromiseLike<E>) | nullReturn a separately mutable Knex snapshot of the union statement.
Render debugging SQL without performing any database calls.
Update matching base and variant columns atomically, honoring hooks and configured timestamps.
Add a synchronous group, retaining the group's inferred named parameters.
Match a record of concrete equality values. Use selectors for parameters.
Match a column and infer a named parameter's storage type.
Add a bound comparison using a supported SQL operator.
Match a fixed value tuple or captured SELECT subquery.
JSON-path strings do not provide a schema-derived parameter type.
Optionaloperator: stringOptionalvalue: A & WithoutParameters<NoInfer<A>>Negate equality while preserving ordinary SQL null semantics.
Match SQL null without changing the declared result type.
Trusted SQL with concrete bindings; use a typed predicate for placeholders.
Trusted SQL with concrete bindings; use a typed predicate for placeholders.
Filter one branch using schema property names; other variants remain unaffected.
Return a new variant view bound to trx.
A
DbSet-like handle scoped to a single polymorphic variant (one branch of a discriminated union entity). All reads are automatically pre-filtered by the discriminator; all writes apply the correct STI / CTI logic.Obtain via
DbSet.ofVariant('key')— analogous to EF Core'sSet<DerivedType>().