rawsql-ts
Version:
[beta]High-performance SQL parser and AST analyzer written in TypeScript. Provides fast parsing and advanced transformation capabilities.
21 lines • 947 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdateClauseParser = void 0;
const Clause_1 = require("../models/Clause");
const SourceExpressionParser_1 = require("./SourceExpressionParser");
/**
* Parses the target of an UPDATE statement (table or source expression with optional alias).
*/
class UpdateClauseParser {
/**
* Parse from lexeme array (returns UpdateClause and new index)
* This method parses a table or a table with alias using SourceExpressionParser.
*/
static parseFromLexeme(lexemes, index) {
// Parse table or table with alias using SourceExpressionParser
const result = SourceExpressionParser_1.SourceExpressionParser.parseFromLexeme(lexemes, index);
return { value: new Clause_1.UpdateClause(result.value), newIndex: result.newIndex };
}
}
exports.UpdateClauseParser = UpdateClauseParser;
//# sourceMappingURL=UpdateClauseParser.js.map
;