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

Support for UNIX sockets #87

Open
nabilfreeman opened this issue Apr 23, 2020 · 1 comment
Open

Support for UNIX sockets #87

nabilfreeman opened this issue Apr 23, 2020 · 1 comment

Comments

@nabilfreeman
Copy link

nabilfreeman commented Apr 23, 2020

Hey there, Knex has support for UNIX sockets when socketPath is supplied to the connection: {} object.

The logic behind it is pretty straightforward, when socketPath is detected it ignores the host and port.

As this uses Knex I think it would be useful to add it. There are a lot of performance benefits to using sockets instead of TCP.

Happy to do this myself if you are accepting PRs.

Thoughts appreciated

@elhigu
Copy link

elhigu commented Apr 23, 2020

Probably not a really easy thing to make work. If you can pull it of nicely with tests it is welcome though.

As this uses Knex I think it would be useful to add it. There are a lot of performance benefits to using sockets instead of TCP.

For performance reasons, usually database runs in a separate computer than node backend. But it could be that some cloud platforms exposes the DB server through unix sockets instead of TCP.

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

No branches or pull requests

2 participants