Skip to content

Comments

sqlx-postgres: add support to abstract sockets#4174

Open
rafonseca wants to merge 1 commit intolaunchbadge:mainfrom
rafonseca:pg-abstract-sockets
Open

sqlx-postgres: add support to abstract sockets#4174
rafonseca wants to merge 1 commit intolaunchbadge:mainfrom
rafonseca:pg-abstract-sockets

Conversation

@rafonseca
Copy link

PostgreSQL treats hosts starting with @ as abstract sockets (linux only). This patch modifies parse to correctly read host parameter as socket in these cases. It also modifies fetch_socket to provide the proper argument to net::connect_uds.
Note that in this case, we cannot pass the host in its standard form in DATABASE_URL because the @ would break the url standard syntax. Instead, we should pass the host as a query parameter (see example in test case).

Does your PR solve an issue?

There is no issue yet

Is this a breaking change?

No. It should not break anything. If someone was using a hostname starting by "@", their setup was already broken.

PostgreSQL treats hosts starting by @ as abstract sockets (linux
only). This patch modifies parse to correctly read host parameter as
socket in these cases. It also modifies fetch_socket to provide the
proper argument to net::connect_uds.
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.

1 participant