trilium/src/routes/api/sql.js

24 lines
381 B
JavaScript
Raw Normal View History

2017-12-15 09:38:56 +08:00
"use strict";
const sql = require('../../services/sql');
async function execute(req) {
2017-12-15 09:38:56 +08:00
const query = req.body.query;
try {
return {
success: true,
rows: await sql.getRows(query)
};
}
catch (e) {
return {
success: false,
error: e.message
};
}
}
2017-12-15 09:38:56 +08:00
module.exports = {
execute
};