Using cockroachdb / postgresql in an iOS swift app


I’m trying to connect to a cockroachdb instance from within an iOS app being developed on xcode. Am using the PostgresClientKit. I get an error saying:

localizedSeverity: Fatal
code: 0C800
message: codeProxyRefusedConnection: connection refused 

Has anyone used this library or any other to successfully pull data from cockroach into an iOS app?

I tried the following code:

import PostgresClientKit

var configuration = PostgresClientKit.ConnectionConfiguration()
            configuration.host = “host.cockroachlabs.cloud"
            configuration.database = “server.table”
            configuration.user = “username”
            configuration.port = 12345
            configuration.credential = .scramSHA256(password: “pass”)
            let connection = try PostgresClientKit.Connection(configuration: configuration)

was expecting it to connect successfully.

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img