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

Cassandra Support #215

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

ViSHNUPrABU
Copy link

@ViSHNUPrABU ViSHNUPrABU commented Dec 27, 2023

I have added Cassandra support and only change in common part is in results_parser in schemas.vim where I trimmed the result and check if it is empty while filtering the array. Before the result is filtered by empty-trim check, so the trim will not be affected to original array. Checkout the pull request for dadbod-completion

Problem:
There is a problem when we connect the db with password in the URL as it shows warning message. So while slicing the output it is improper. Kindly fix that issue.

@kristijanhusak
Copy link
Owner

Before the result is filtered by empty-trim check, so the trim will not be affected to original array

Why do we need to apply trim to the original array? What issues happen if we do not apply the trim?

I'd like to avoid doing double mapping here if not necessary. If we get entries that needs to be trimmed we can do that on another place where we already map out the results.

@ViSHNUPrABU
Copy link
Author

Why do we need to apply trim to the original array? What issues happen if we do not apply the trim?

In Cassandra, the received output has leading and trialing spaces, so the keyspaces and tables are not mapped at all if not trimmed.

I'd like to avoid doing double mapping here if not necessary. If we get entries that needs to be trimmed we can do that on another place where we already map out the results.

We can also iterate the dictionary and trim but trimming while splitting result seems easy for me. We can move the trimming part to another variable below the "mapped" variable.

@kristijanhusak
Copy link
Owner

I checked if there is maybe a faster way to do it but it seems that using map and filter is the most performant.
I think this will be good to go once tpope/vim-dadbod#148 is merged

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

Successfully merging this pull request may close these issues.

2 participants