mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
Merge pull request #4032 from mechanarchy/patch-1
Ignore SQL comments in query console
This commit is contained in:
commit
8eb091445b
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user