Reputation: 3780
Azure's offline-sync API does not offer a full ORM, but does provide basic class-to-table mapping.
The sample project's TodoItemManager
has this:
store.DefineTable<TodoItem>();
Should this be done on the mobile app's first run only, or is it safe to call each time it starts? Hence, does it perform a "create if not exists" sort of operation?
And, what if the class' schema changes?
Upvotes: 1
Views: 65
Reputation: 8035
Azure Mobile Apps does the equivalent of a "create if not exists" on your SQLite database - it's safe to call it each time your app starts.
Upvotes: 2
Reputation: 4163
The Data Sync service syncs data only. While it’s capable of creating the corresponding tables being synched on a member database during provisioning, it only creates the bare minimum to be able to sync. It will not create or sync stored procedures, triggers or views from the source database. If you want the target database members to have a full fidelity copy of the database schema from the source, you can script the source database and run the script on the target database members first.
Moreover, if you change the schema of your member databases, these changes will not be picked up and synched by the service. Only columns explicitly selected as part of the Dataset in Sync Group will be synched. If you want to include or remove columns as result of a schema change, you will have to modify the sync group.
https://jtabadero.wordpress.com/2012/08/23/things-you-need-to-know-about-sql-data-sync-service/
Upvotes: 1