UNPKG

@sequeljs/ast

Version:

A SQL AST manager for JavaScript

31 lines 743 B
import Limit from '../nodes/Limit'; import Offset from '../nodes/Offset'; import buildQuoted from '../nodes/buildQuoted'; export default class StatementMethods { get key() { return this.ast.key; } set key(val) { this.ast.key = buildQuoted(val); } set wheres(val) { this.ast.wheres = val; } offset(offset) { if (offset) { this.ast.offset = new Offset(buildQuoted(offset)); } return this; } order(...expr) { this.ast.orders = expr; return this; } take(limit) { if (limit) { this.ast.limit = new Limit(buildQuoted(limit)); } return this; } } //# sourceMappingURL=StatementMethods.js.map