Large initial database

This forum contains topics that were moved from Get Satisfaction
Bruno Grenier
Posts: 0
Joined: Thu Aug 20, 2015 9:41 pm

Large initial database

Post by Bruno Grenier »

Hi, i need to initiate the app with a lot of storage (ONLY OFFLINE).
Example:
County 1 - City 1 - User 1
County 1 - City 1 - User 2
County 1 - City 1 - User 3
...
County 1 - City 2 - User 1
County 1 - City 2 - User 2
County 1 - City 2 - User 3
...
County 2 - City 1 - User 1
County 2 - City 1 - User 2
County 2 - City 1 - User 3
...
County 2 - City 2 - User 1
County 2 - City 2 - User 2
County 2 - City 2 - User 3
...
more than 10.000 registers

and the app will access those records during the user uses.

Do i have to use json?? SQLite??
Some example?

Serhii Kulibaba
Posts: 147
Joined: Tue Aug 27, 2013 1:47 pm

Large initial database

Post by Serhii Kulibaba »

Hello Bruno,

The best way is using SQLite (Web SQL). You can use it in generic services.
Example: http://www.tutorialspoint.com/html5/h...

Bruno Grenier
Posts: 0
Joined: Thu Aug 20, 2015 9:41 pm

Large initial database

Post by Bruno Grenier »

Thanks Sergiy!
But this way I will create the table, then AFTER I will populate.
I would like to create a pre-populated table.
Like build-in OFFLINE database.
When I launch the application I will only read the data (not create tables, populate tables then to read tables)

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Large initial database

Post by Yurii Orishchuk »

Hi Bruno,

Unfortunatly you can not prepopulate SQLite with app installing.

But you can implement such logic in your app.

Here is a basic plan:

1 Add JS asset to your APP. Inside this JS asset you need to populate all needed data.

2 In app run (for example "page load" for start page) you need to check whether there needed table inside SQLite.

3 If there is no needed table - you will get all data from JS asset(1st step) and put it into SQLite(simultaneously creating needed tables).

4 if there is needed tables - you can pass 3rd step.

Also you can use some source file in sources tab to load it only in time when it needs. (just to optimize the solution).

Regards.

Post Reply