I am writing an application in Swift that should be able to interact with the external Database.
The database is already created, and it exists on the remote MS SQL server. The database is not exposed as a web service, instead I can only access it through the connection string I was given.
Connection string is formatted like so:
data source={server_domain}\SQL2012,3000;initial catalog={my_catalog};persist security info=True;user id={username};password={password};I have found that such problems are usually solved by writing the server-side script that queries the Database, and then retrieves the data in JSON or XML format that can easily be parsed into objects. However, I don't have such option since I have no access to the server-side, the server is located at my University and I do not own it.
That said, I would need to connect to the DB directly, and not by using some PHP server-side scripts or similar stuff.
I have done similar thing in .NET using NHibernate, where the connection string was used to connect to the database, and all DB manipulation was easily done from the C# code.
How should one do that in Swift? Any advices on how I should approach this task? Could Core-Data help in any way?