I have an existing database up and running on the remote MS SQL server
, and I want to be able to communicate and interact with that database from Xcode
. I am writing an application for OS X
in Swift
, and the data that the application should use, is stored in that remote database.
The problem is, I can't seem to find any Swift
library that could connect to the MS SQL server
based database. So far, I have only found this open-source library: SQLClient in Objective-C, but it's quite difficult to have it set, especially as I am not familiar with the Objective-C
.
Also, I keep seeing this Core-Data
library being mentioned anytime there is some communication with the database, but as far as I understand Core-Data
doesn't know how to connect to the MS SQL
database.
Does anyone have any experience in connecting the Xcode Swift app
to the remote MS SQL
database? How should one do this? Any kind of advice is more than welcome, because right now I am kind of stuck with this problem.
Connect to a SQL Server instanceStart SQL Server Management Studio. The first time you run SSMS, the Connect to Server window opens. If it doesn't open, you can open it manually by selecting Object Explorer > Connect > Database Engine. For Server type, select Database Engine (usually the default option).
All replies. You can use the C-Interface routines to pass SQL commands to a Database with X-Code - all of the Database programs have C and Java libraries for that purpose.
SQLite is a C API that will have you work with both SQL, and... C from Swift. There exist Swift libraries that wrap the C functions in Swift, so that you don't have to learn C from Swift: GRDB - this is my favourite since I created it - but many other people love it as well.
The ideal way is to write webservices in any serverside language such as php, asp etc. The webservices will communicae with your mysql database and you swift code will communicate to the webservices.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With