tpope / vim-dadbod

dadbod.vim: Modern database interface for Vim
https://www.vim.org/scripts/script.php?script_id=5665
3.75k stars 132 forks source link

URL regex/format #158

Closed xpegenaute closed 10 months ago

xpegenaute commented 10 months ago

Hi,

I miss some documentation about the expected URL format or enough examples about it. Actually. I am trying to develop a new adapter and I need an url like this:

dbcompanyname://user:password@host:port/userdbname

I saw that this format is not supported by the db#url#parse because it went directly to the opaque field.

I tried to understand your regexp and propose a modification, but sincerely, I had problems following the regexp expression. Probably because vimscrip is not one of my comfort area languages.

Do you know how I can workaround it ? or at least implement it ?

Regards

tpope commented 10 months ago

The format is supported fine. But port needs to be a number. That's the reason it returns an opaque URL for db#url#parse('dbcompanyname://user:password@host:port/userdbname'). Try db#url#parse('dbcompanyname://user:password@host:1234/userdbname').