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

Socket support for mysql connections #53

Open
mknoszlig opened this issue Mar 13, 2022 · 3 comments
Open

Socket support for mysql connections #53

mknoszlig opened this issue Mar 13, 2022 · 3 comments

Comments

@mknoszlig
Copy link

The mysql connectorJ library does not include support for connections over unix sockets.
https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-unix-socket.html

The documentation states that this support can be added via a third party lib and suggests
https://kohlschutter.github.io/junixsocket/

It appears that this could be useful for other DBs as well (eg postrgesql).

Not sure exactly what the overhead would be, but if it's not too large would you be open to include the necessary parts of the junixsocket lib? Happy to work on a PR for this.

@borkdude
Copy link
Collaborator

@mknoszlig Unix domain sockets are natively supported in JDK 17. Maybe we could just use GraalVM JDK 17 and use the native versions? I expect MySQL and Postgres will (soon?) add support for those.

/cc @lispyclouds

@lispyclouds
Copy link
Member

Yeah either we implement the SocketFactory classes for MySQL, Postgres etc using the JDK 17 Unix Socket facilities or wait for the JDBC drivers to have support for it for JDK 17. I would say waiting for the JDBC support could be better as I'm not sure what kind of jdbc url format would be used for this. If that's known we can support this now by implementing the factory classes for now and later drop it when JDBC supports it natively?

@mknoszlig
Copy link
Author

mknoszlig commented Mar 14, 2022

I'll see if i can come up with an implementation of SocketFactory based on the JDK 17 Unix Socket for mysql. Once JDBC supports it natively we can just drop that implementation again. For now i would use the same route as used in the junixsocket impementation: provide the socket factory as a jdbc parameter and having the path to the socket as a property.

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

3 participants