mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01: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
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "trilium",
|
"name": "trilium",
|
||||||
"version": "0.23.1",
|
"version": "0.24.0-beta",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -50,7 +50,12 @@ async function execute(e) {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
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", {
|
const result = await server.post("sql/execute", {
|
||||||
query: sqlQuery
|
query: sqlQuery
|
||||||
|
Loading…
x
Reference in New Issue
Block a user