Using Core Data in remote SQL - objective-c

I want to use Core Data for managing remote sql server. Is that possible? I checked through the apple documentation and it only shows about SQLite, but on CS193P stanford lectures they say that it is possible to do, but don't say how?
I currently use a bridge with php queries, but that is not OOP way
Thank you.

According to Apple, the answer is no:
How do I use my existing SQLite database with Core Data?
You don’t. Although Core Data supports SQLite as one of its persistent store types, the database format is private. You cannot create a SQLite database using native SQLite API and use it directly with Core Data (nor should you manipulate an existing Core Data SQLite store using native SQLite API). If you have an existing SQLite database, you need to import it into a Core Data store (see “Efficiently Importing Data”).

Related

Convert an online JSON set of files to a relational DB (SQL Server, MySQL, SQLITE)

I'm using a tool called Teamwork to manage my team's projects.
The have an online API that consists of JSON files that are accessible with authorisation
https://developer.teamwork.com/projects/introduction/welcome-to-the-teamwork-projects-api
I would like to be able to convert this online data to an sql db so i can create custom reports for my management.
I can't seem to find anything ready to do that.
I need a strategy to do this..
If you know how to program, this should be pretty straightforward.
In Python, for example, you could:
Come up with a SQL schema that maps to the JSON data objects you want to store. Create it in a database of your choice.
Use the Requests library to download the JSON resources, if you don't already have them on your system.
Convert each JSON resource to a python data structure using json.loads.
Connect to your database server using the appropriate Python library for your database. e.g., PyMySQL.
Iterate over the python data, inserting rows into the database as appropriate. This is essentially the JSON-to-Tables mapping from step 1 made procedural.
If you are not looking to do this in code, you should be able to use an open-source ETL tool to do this transformation. At LinkedIn a coworker of mine used to use Talend Data Integration for solid ETL work of a very similar nature (JSON to SQL). He was very fond of it and I respected his opinion, so I figured I should mention it, although I have zero experience of it myself.

How can I store large binary objects in azure sql db?

I have a local ASP.NET web site (database contains some pictures as binary objects) that I want deploy to Azure web services. How can I store pictures in Azure SQL DB?
I'm trying this query, but..
Is there another way to keep large binary object in Azure DB? Thanks for any replies!
you can use other way to do that. You can use SqlStream class written in C# code.
because bulk insert is not permit in sql database.
check these link, that have a way to do that:
https://azure.microsoft.com/en-us/blog/streaming-blobs-to-and-from-sql-azure/

Can I retrieve data from the server and store it in core data?

I'm a newbie and working on a pull to refresh app.
I have watched the tutorial of using Sqlite3 in ios6 to build data driven app. When the user pull to refresh the app will load the data from the server and then store it locally and display it on the tableView and the user can also edit and save back to the server.
Can this be done using core data not Sqlite3? because I find it really difficult to make Objective-C interface that will interact with C language (the Sqlite3).
Or are there any better solution?
You can use Core Data for this task. You can use Mogenerator with Core data to create a core data model for you. Then use Magical Records to easy saving and fetching of core data. These two libraries make Core Data super simple and nice. As for pulling info from the server, you'll have to model the data recieved to the models created by Mogenerator and then save them into core data. Again with taking data from core data and pushing it to a server, depending on what you're using to communicate with the server, you'll need to create a dictionary to mimic the JSON you'll need to send to the server and then push it off. As far as I know theres nothing to directly communicate the info from Core Data directly to the server. Anyway you'll probably have to play around with this concept, but my recommendation is definitely use Mogenerator to get the core data NSManagedObjects and then MagicalRecord for super easy saving and fetching.

how to have database offline for iOS app

I would like to develop dictionary app for iOS application. and I am not sure which database Managment system should I use to store data. I want to my app to be offline so even user that don't have internet, they still can use my app. so my question which database should I use to store my database ? I research on google, it said sqlite. so if i store my data in sqlite so will my data in database sqllite will go with my app? thank
Yes, sqlite is your DB of choice unless you're just working with a couple of dozen records.
If you plan to use CoreData, you can also address sqlite with it.
If you don't plan to use CoreData, you can still use sqlite and work directly with the DB. There are good wrappers which help you, like FMDB: https://github.com/ccgus/fmdb

Objective-c - How to store objects in database SQLite

I'm curious to learn more about storing objects.
If I have an app that manage an office database where I have model object like Department, Employee, Task. How can I store them in the database?
Should I create a table for each model and store the primitive instance values like name, id, surname ? Or should I store the object itself?
Which is the right approach??
To better understand:
How an app like whatsapp or kik (both chat/messaging application) store their data in their server? Do they use coredata or databases? Do they save primitive values or objects?
A popular pratice is to use Core Data to store locally and use Web API to sync with server.
For example, we're developing an app using Core Data to map objects to SQLite, handled by API apple provided, and using RestKit, an third-party library to map objects to requests understandable to server API, thus, you can see your data published on server
Not quite sure it's what your're asking for, this pratice is straightforward for manipulating complicated objects, compared to using SQL directly.