mirror of
https://github.com/zadam/trilium.git
synced 2025-11-14 17:25:52 +01:00
fix update/delete queries in SQL console
This commit is contained in:
@@ -22,12 +22,19 @@ function execute(req) {
|
||||
try {
|
||||
const results = [];
|
||||
|
||||
for (const query of queries) {
|
||||
if (!query.trim()) {
|
||||
for (let query of queries) {
|
||||
query = query.trim();
|
||||
|
||||
if (!query) {
|
||||
continue;
|
||||
}
|
||||
|
||||
results.push(sql.getRows(query));
|
||||
if (query.toLowerCase().startsWith('select')) {
|
||||
results.push(sql.getRows(query));
|
||||
}
|
||||
else {
|
||||
results.push(sql.execute(query));
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user