trilium/src/routes/api/sql.js
2018-03-30 17:07:41 -04:00

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
};