Hi there, I’m trying to develop a Native Ktor Server, but I wanted to see if it would be possible to connect to a PostgreSQL database with Kotlin Native. Is this actually a possibility or how can this be done? Otherwise, I’m just going to use files to make a small demo about this.
Are there easy ways to call, like for example a postgres command, from the command line easily via Kotlin Native?
1 Like
Hi, unfortunately I think there’s nothing usable at the moment. I’ve summarized my research here: Add support for postgresql · Issue #12 · mvysny/solar-controller-client · GitHub
1 Like
This usually requires establishing a socket connection to and interacting with postgresql. You can use the tcp socket from the ktor-client section. This is the authentication protocol of postgresql
https://www.postgresql.org/docs/current/runtime-config-connection.html