Merge pull request #4032 from mechanarchy/patch-1

Ignore SQL comments in query console
This commit is contained in:
zadam 2023-06-26 23:05:42 +02:00 committed by GitHub
commit 8eb091445b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,12 @@ function execute(req) {
for (let query of queries) {
query = query.trim();
while (query.startsWith('-- ') {
// Query starts with one or more SQL comments, discard these before we execute.
const pivot = query.indexOf('\n');
query = pivot > 0 ? query.substr(pivot + 1).trim() : "";
}
if (!query) {
continue;
}