mirror of
https://github.com/zadam/trilium.git
synced 2024-11-17 13:14:44 +08:00
24 lines
No EOL
381 B
JavaScript
24 lines
No EOL
381 B
JavaScript
"use strict";
|
|
|
|
const sql = require('../../services/sql');
|
|
|
|
async function execute(req) {
|
|
const query = req.body.query;
|
|
|
|
try {
|
|
return {
|
|
success: true,
|
|
rows: await sql.getRows(query)
|
|
};
|
|
}
|
|
catch (e) {
|
|
return {
|
|
success: false,
|
|
error: e.message
|
|
};
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
execute
|
|
}; |