3

I'm making an application on xcode 8.3.3 and am using swift to make the app. We have a hosted postgres database which is up and running but I don't know how to connect to it through swift and xcode. I have a host, port number, username and password but I don't know how to connect to the database so I can get the data. I'm a newbie to xcode, swift and basically programming in general please help.

1 Answer 1

4

A simple google search would yield tremondous results.

http://druware.tumblr.com/post/112163075395/getting-started-with-pgsqlkit-and-swift

I believe the above link should get you sorted.

Basically you have to use the C API libpq library.

See also: https://github.com/stepanhruda/PostgreSQL-Swift

Sign up to request clarification or add additional context in comments.

3 Comments

Hey, thanks but how do import the code from [link] (druware.com/pgsqltouch) as a .framework file?
Sorry but there's another problem. The apple link isn't opening and the stackoverflow link helps but the problem is that the code isn't downloadable as a framework nor is it possible to copy it into a cocoa touch framework because it requires you to import "GenDBConnection" which currently doesn't exist. Can you help me with that? @David Farrugia

Your Answer

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.