mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 15:25:51 +01:00
ability to run multiple queries (and get multiple result sets) from SQL console
This commit is contained in:
@@ -17,12 +17,18 @@ async function getSchema() {
|
||||
}
|
||||
|
||||
async function execute(req) {
|
||||
const query = req.body.query;
|
||||
const queries = req.body.query.split("\n---");
|
||||
|
||||
try {
|
||||
const results = [];
|
||||
|
||||
for (const query of queries) {
|
||||
results.push(await sql.getRows(query));
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
rows: await sql.getRows(query)
|
||||
results
|
||||
};
|
||||
}
|
||||
catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user