vim-dadbod-ui
vim-dadbod-ui copied to clipboard
Saved Queries Not Accessible When Connection Name Contains Square Brackets (`[` and `]`)
Issue: Saved Queries Not Accessible When Connection Name Contains Square Brackets ([ and ])
Description
I encountered an issue with vim-dadbod-ui where saved queries are not accessible in the "Saved Queries" section if the connection name contains both a left square bracket ([) and a right square bracket (]).
Steps to Reproduce
- Define a connection in
g:dbswith a name containing both square brackets. For example:vim.g.dbs = { ["[my_database]"] = "postgres://user:password@localhost:5432/my_database" } - Open the
vim-dadbod-uidrawer and select the connection. - Execute a query and save it using
<Plug>(DBUI_SaveQuery)or an equivalent command. - Attempt to open the "Saved Queries" section for the connection.
Observed Behavior
- Saved queries are not accessible under the "Saved Queries" section.
- No error is explicitly shown, but the plugin fails to open the directory corresponding to the connection.
Expected Behavior
- Saved queries should be accessible regardless of the characters in the connection name.
Additional Information
- Removing the square brackets (
[and]) from the connection name resolves the issue. - This appears to be related to how square brackets are interpreted in file paths or plugin logic.
Environment
- Plugin Version: 0fec59e
- Neovim Version: NVIM v0.11.0-dev-1216+g9a681ad09e
- Operating System: Debian 6.1.119-1
Suggested Fix
- Sanitize or escape special characters like
[and]in connection names when creating or accessing saved queries. - Alternatively, document restrictions on allowed characters in connection names.
Thank you for the great plugin! Please let me know if you need additional details or logs to troubleshoot this issue.
I had the same problem, thank you for making the issue!