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

add junixsocket to deps to enable socket file based postgresql connection #110

Open
wucke13 opened this issue Jan 29, 2024 · 0 comments
Open

Comments

@wucke13
Copy link

wucke13 commented Jan 29, 2024

See c85217b

This commit adds the junixsocket library to the dependencies. This
allows the usage of a UNIX domain socket connection to a postgresql
server. This promises both better performance, and it allows to use
a Linux user identity for authentication against the DB (versus
username/password auth for TCP/IP based communication to the DB).

The change is non-intrusive, i.e. per default TCP/IP is still used and
works as intended.

For more information, checkout:

In particular, setting the following two properties in the
persistence.xml suffices to connect to a postgresql via a socket file:

javax.persistence.jdbc.url='jdbc:postgresql://localhost/db-name?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$SystemProperty'
org.newsclub.net.unix.socket.default=/run/postgresql/.s.PGSQL.5432
diff --git a/build.sbt b/build.sbt
index 80054dd..12ec88b 100644
--- a/build.sbt
+++ b/build.sbt
@@ -18,6 +18,7 @@ libraryDependencies += "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.
 libraryDependencies += "com.fasterxml.jackson.datatype" % "jackson-datatype-hibernate5" % "2.9.8"
 libraryDependencies += "io.swagger" % "swagger-play2_2.12" % "1.6.0"
 libraryDependencies += "org.reflections" % "reflections" % "0.9.10"
+libraryDependencies += "com.kohlschutter.junixsocket" % "junixsocket-core" % "2.8.3"
 
 javacOptions ++= Seq("-s", "app")
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

1 participant