Best/advised way to connect to postgresql database

I want to connect to a postgresql database and execute one statement
-1) connect to the database (postgresql13-server-13.6)
( an IP-address, a Port, a Database, a user, a password)
-2) select * from users and store the result in “something”
What is the best/advised way.
-I need some simple example
-A synchronous api is fine as these are mostly more simple.
-If possible using Functional paradigm.

I had a look at slick which uses H2 in its demo but have totally no idea to change this to what i want to do. (The docs are overwhelming)
Alternatives are using java jdbc api or quill ?

Personally, I prefer Doobie (which has somewhat less intimidating docs), but there are scads of alternatives. If you’re looking for Functional, I probably wouldn’t go with JDBC, which is relatively low-level.

1 Like

Within 10 minutes i had a running application using Doobie. Cool.

2 Likes