mirror of
https://github.com/zadam/trilium.git
synced 2025-02-22 05:56:03 +08:00
sql console executes selected text if there's a selection instead of the whole content
This commit is contained in:
parent
228a77cb89
commit
1ee8d9fd93
2 changed files with 7 additions and 2 deletions
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "trilium",
|
||||
"version": "0.23.1",
|
||||
"version": "0.24.0-beta",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue