You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
311 B
JavaScript

'use strict';
let insertRegex = /^insert into "([^"]+)"/;
let updateRegex = /^update "([^"]+)"/;
module.exports = function getTable(query) {
let match;
if (match = insertRegex.exec(query)) {
return match[1];
} else if (match = updateRegex.exec(query)) {
return match[1];
}
};