mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 03:46:37 +01:00
sql console executes selected text if there's a selection instead of the whole content
This commit is contained in:
@@ -50,7 +50,12 @@ async function execute(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
const sqlQuery = codeEditor.getValue();
|
||||
// execute the selected text or the whole content if there's no selection
|
||||
let sqlQuery = codeEditor.getSelection();
|
||||
|
||||
if (!sqlQuery) {
|
||||
sqlQuery = codeEditor.getValue();
|
||||
}
|
||||
|
||||
const result = await server.post("sql/execute", {
|
||||
query: sqlQuery
|
||||
|
||||
Reference in New Issue
Block a user