mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 13:26:01 +01:00
Ignore SQL comments in query console
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user