7

In a Swift app, how does one connect to a Postgres database server?

How to do the equivalent from Swift?

asked Mar 26, 2016 at 2:21
2
  • 1
    You can call any C code in Swift. Commented Mar 26, 2016 at 11:45
  • @Basil Bourque have u found any solution, if yes please share it with us Commented Jun 14, 2016 at 15:48

2 Answers 2

6

You may use Postgres C API libpq. However, at least a thin layer of Swift will be needed to make it object-oriented and ARC compliant. An example implementation of that layer may be like so: stepanhruda/PostgreSQL-Swift.

answered Jul 14, 2016 at 14:45
1

You can try to use PostgresClientKit

answered Apr 16, 2022 at 11:00

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.