ts-mysql-analyzer
Version:
A MySQL query analyzer.
18 lines • 681 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function getSchemaTable(tableName, tables, aliasRefs) {
const schemaTable = tables.find(t => t.name === tableName);
if (schemaTable) {
return schemaTable;
}
const tableAlias = aliasRefs.find(r => r.alias === tableName);
if (tableAlias) {
const schemaTable = tables.find(t => { var _a; return t.name === ((_a = tableAlias.tableReference) === null || _a === void 0 ? void 0 : _a.table); });
if (schemaTable) {
return schemaTable;
}
}
return null;
}
exports.getSchemaTable = getSchemaTable;
//# sourceMappingURL=get-schema-table.js.map