Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saved Queries Not Accessible When Connection Name Contains Square Brackets ([ and ]) #296

Open
flskillcorner opened this issue Jan 3, 2025 · 0 comments

Comments

@flskillcorner
Copy link

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

  1. Define a connection in g:dbs with a name containing both square brackets. For example:
    vim.g.dbs = {
        ["[my_database]"] = "postgres://user:password@localhost:5432/my_database"
    }
  2. Open the vim-dadbod-ui drawer and select the connection.
  3. Execute a query and save it using <Plug>(DBUI_SaveQuery) or an equivalent command.
  4. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant