Last Updated: 3/9/2026
- AliasedJSONPathBuilder
Class AliasedJSONPathBuilder
A type that holds an expression and an alias for it.
AliasedExpression can be used in places where, in addition to the value type T, you also need a name A for that value. For example anything you can pass into the select method needs to implement an AliasedExpression. A becomes the name of the selected expression in the result and T becomes its type.
Examples
import { AliasNode, type AliasedExpression, type Expression, IdentifierNode} from 'kysely' class SomeAliasedExpression< T, A extends string> implements AliasedExpression< T, A> { #expression: Expression< T> #alias: A constructor(expression: Expression< T>, alias: A) { this. #expression = expression this. #alias = alias } get expression(): Expression< T> { return this. #expression } get alias(): A { return this. #alias } toOperationNode(): AliasNode { return AliasNode. create( this. #expression. toOperationNode(), IdentifierNode. create(this. #alias) ) }}Type Parameters
- O
- A extends string
Implements
Index
Constructors
Methods
Constructors
constructor
-
new AliasedJSONPathBuilder<O, A extends string>(
jsonPath: TraversedJSONPathBuilder<any, O>,
alias: Expression| A,
): AliasedJSONPathBuilder<O, A>Type Parameters
- O
- A extends string
Parameters
- jsonPath: TraversedJSONPathBuilder<any, O>
- alias: Expression
| A
Returns AliasedJSONPathBuilder<O, A>
Methods
toOperationNode
-
toOperationNode(): AliasNode
Creates the OperationNode that describes how to compile this expression into SQL.
Returns AliasNode
Settings
Member Visibility
On This Page
ExamplesConstructors
Methods