@uwdata/mosaic-sql
Version:
SQL query construction and analysis.
26 lines • 806 B
JavaScript
import { FRAGMENT } from '../constants.js';
import { ExprNode } from './node.js';
/**
* A SQL AST node made up of disjoint fragments that are combined to form
* a coherent expression. Along with verbatim content, this class serves
* as an "escape hatch" for handling more unstructured SQL content.
*/
export class FragmentNode extends ExprNode {
/** The consecutive parts making up the fragment. */
spans;
/**
* Instantiate a fragment node with arbitrary content.
* @param spans The consecutive parts making up the fragment.
*/
constructor(spans) {
super(FRAGMENT);
this.spans = spans;
}
/**
* Generate a SQL query string for this node.
*/
toString() {
return this.spans.join('');
}
}
//# sourceMappingURL=fragment.js.map