kristijanhusak / vim-dadbod-ui

Simple UI for https://github.com/tpope/vim-dadbod
MIT License
1.36k stars 70 forks source link

Cassandra Support #215

Open ViSHNUPrABU opened 6 months ago

ViSHNUPrABU commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 6 months ago

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 https://github.com/tpope/vim-dadbod/pull/148 is merged