mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
Ignore SQL comments in query console
This commit is contained in:
parent
6f16b4caec
commit
af053b61fc
@ -36,6 +36,11 @@ function execute(req) {
|
||||
if (!query) {
|
||||
continue;
|
||||
}
|
||||
|
||||
while (query.startsWith('-- ') {
|
||||
// Query starts with one or more SQL comments, discard these before we execute.
|
||||
query = query.substr(query.indexOf('\n') + 1)
|
||||
}
|
||||
|
||||
if (query.toLowerCase().startsWith('select') || query.toLowerCase().startsWith('with')) {
|
||||
results.push(sql.getRows(query));
|
||||
|
Loading…
x
Reference in New Issue
Block a user