UNPKG

@breautek/storm

Version:

Object-Oriented REST API framework

21 lines 756 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SetSessionVariableQuery = void 0; const Query_1 = require("./Query"); class SetSessionVariableQuery extends Query_1.Query { _getQuery() { let params = this.getParameters(); if (!/^([A-Za-z_])+([a-zA-Z0-9_])+$/g.test(params.name)) { throw new Error('Illegal Variable Name'); } // Only allow alpha letters & underscores for variable names return `SET SESSION \`${params.name}\` = :value`; } getParametersForQuery() { return { value: this.getParameters().value }; } } exports.SetSessionVariableQuery = SetSessionVariableQuery; //# sourceMappingURL=SetSessionVariableQuery.js.map