vim-dadbod-completion icon indicating copy to clipboard operation
vim-dadbod-completion copied to clipboard

alias parsing: can only represent a single alias for a table

Open emmanueltouzery opened this issue 1 year ago • 0 comments

vim-dadbod-completion cannot represent all the aliases for this query:

select * from race
join location start_location on start_location.id = race.start_location_id
join location end_location on end_location.id = race.end_location_id
where start_location.

The problem is that aliases are represented in an associative array, the key of which is the target of the alias. So in this case the table should be:

{
  location: "start_location",
  location: "end_location"
}

unfortunately that's impossible, the second write overwrites the first, and we end up with only:

{
  location: "end_location"
}

so the completion for start_location cannot work.

i'd be happy to make PR to fix that, sadly I know lua but not vimL, and it was already not easy to understand as much as I did :(

otherwise, this, together with dadbod-ui, is just a killer setup! thank you a lot for your work!

emmanueltouzery avatar Jul 05 '24 18:07 emmanueltouzery