Comments (2)
Actually I was wrong, some weird behavior of the result window is not from vim-dadbod-ui BUT from vim-dadbod plugin: https://github.com/tpope/vim-dadbod which is supposed to be minimal and flexible..
Using vim-dadbod without the other UI plugin
When using vim-dadbod without the UI from vim-dadbod-ui plugin, it is much better, and I have a better control on the windows, buffers, etc..
For example:
:e some_file.sql
# Set current DB for the buffer
:DB b:db = $INVENTORY_DATABASE_URI
# visual select a query, then run
:'<,'>DB b:db
# This show the special buffer with the result
I want my own flexible UI on top of vim-dadbod !!
I want to pin & name a result buffer
Currently the result buffer is volatile, simply running :CtrlSpace or running another query will hide the buffer.
Probably because of:
https://github.com/tpope/vim-dadbod/blob/779e8d6efc89b68be951ac1419baae75541cf51c/autoload/db.vim#L163
AND
https://github.com/tpope/vim-dadbod/blob/4a2a8bc6dca50bc58885bdf2c0a153d0990d7872/autoload/db.vim#L282
---> this last link tells us that the result window is a PREVIEW WINDOW!!! Instead it should be a proper window with configurable lifecycle!
---> That's why when I edit a query and do completion, the preview of the completion replaces the result window :/ too bad...
The result window should not be created (in an hardcoded way) by the plugin, it should be configurable, with a default value to pedit
to open a preview window.
I want to be able to 'pin' a result buffer, so it does not disappear while I'm looking away, run :CtrlSpace, or run another query.
----> might need to change vim-dadbod? I could contribute to the plugin?
I want to give a 'virtual name' to a result buffer, without saving it to the file system when pinning, so I know what that result is about (e.g: "all resource types") (in vim's buffer list, in the status line, ...)
I want to see the result's input query in the result buffer
or have a mapping to show it / toggle it at the beginning of the result buffer.
I want to reload the result's buffer with the same query
vim-dadbod already has a mapping for that, but it doesn't seem to work...
The saved file for the query linked to a result buffer uses the interactive :DB<cr>
command..
Suggestion:
In vim-dadbod, support b:some_var format for the query.
Then for a result buffer:
- store the input query as a b:db_input_content variable
- store the database used in a variable like b:db_uri
Then to replay the query:
:DB b:db_uri b:db_input_content
I want helper mappings, displays while writing queries
(ultimate would be to have some of these info in a floating window, but then how to position this window in non-obstrusive way?)
- one to show the columns of a table (when I have the cursor on the (schema.)table name)
- one to show the tables
- one to create a new query buffer associated to the same db (or do I set g:db or t:db and use that always? I'd prefer no)
A discoverable tree view of the database would be helpful (similar to vim-dadbod-ui, but less rigid and simpler)
from dotfiles.
Another option: https://github.com/nanotee/sqls.nvim
This is a SQL language server
It supports executing sql commands through the language server..
The nvim layer is really simple, it should be easy to hack on!
from dotfiles.
Related Issues (20)
- Fzf can (now!) be used as a ripgrep searcher AND filter ❤️❤️
- Universal alphanum identifier completion, bypassing iskeyword HOT 1
- Add in-snippet indicator in statusline HOT 1
- Have a kind of json-editor-mode HOT 2
- Terminal/Editor focus or EditorSplit/EditorSplit focus isn't visually clear/distinct
- Arbitrary keybind modes (not just normal,insert,visual,...) like vscode HOT 1
- bin: `after-do` to run a command after time or existing pid
- Use small :cmdline abbreviation for some operations (TODO: need to find balance)
- In-terminal font viewer/checker
- ~As-you-type completion in shell (but not everywhere?) HOT 1
- lsp: Almost inline rename UI HOT 1
- Spaced repetition tool
- Jumper to a visible language control-structure HOT 1
- Move to next/prev line with same or less/more indentation
- ⚠️ Add low battery warning ⚠️ HOT 1
- lsp: Diagnostics, wanted display HOT 4
- Add generic visual selection _extension_ using existing text objects
- Text object using ad-hoc tree-sitter queries from nodes under cursor
- Fix hard-to-reproduce bug when writing in nvim, and the entire tmux pane is copied HOT 1
- IDEAS for having multiple neovim configs (using `nvim -u /path/to/config.vim`) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotfiles.