29 lines
962 B
TypeScript
29 lines
962 B
TypeScript
import type { AliasableExpression } from '../expression/expression.js';
|
|
import type { SelectQueryNode } from '../operation-node/select-query-node.js';
|
|
export interface SelectQueryBuilderExpression<O> extends AliasableExpression<O> {
|
|
get isSelectQueryBuilder(): true;
|
|
/**
|
|
* Creates the OperationNode that describes how to compile this expression into SQL.
|
|
*
|
|
* ### Examples
|
|
*
|
|
* If you are creating a custom expression, it's often easiest to use the {@link sql}
|
|
* template tag to build the node:
|
|
*
|
|
* ```ts
|
|
* import { type Expression, type OperationNode, sql } from 'kysely'
|
|
*
|
|
* class SomeExpression<T> implements Expression<T> {
|
|
* get expressionType(): T | undefined {
|
|
* return undefined
|
|
* }
|
|
*
|
|
* toOperationNode(): OperationNode {
|
|
* return sql`some sql here`.toOperationNode()
|
|
* }
|
|
* }
|
|
* ```
|
|
*/
|
|
toOperationNode(): SelectQueryNode;
|
|
}
|