UNPKG

@uwdata/mosaic-sql

Version:

SQL query construction and analysis.

36 lines 829 B
/** * Check if a value is a SQL AST node. * @param value The value to check. */ export function isNode(value) { return value instanceof SQLNode; } export class SQLNode { /** The SQL AST node type. */ type; /** * Instantiate a SQL AST node. * @param type The SQL AST node type. */ constructor(type) { this.type = type; } /** * Create a shallow clone of this SQL AST node. * @returns The shallow clone node. */ clone() { // @ts-expect-error use constructor const clone = new this.constructor(); for (const key in this) { clone[key] = this[key]; } return clone; } } /** * AST node corresponding to an individual expression. */ export class ExprNode extends SQLNode { } //# sourceMappingURL=node.js.map