Page 4 of 7

Support for local SQLite datasources

Posted: Tue May 21, 2013 7:16 pm
by ApperyAmateur

Thanks.

I found an SQLite IDE so thats allowed me to create the database and import data etc.

If I upload the database under 'files' in backend services within appery, would this attach the db file to my app then I can try to access it locally as above? I presume its not quite this easy to attach a db, I'm thinking it needs exporting first and attaching later.

But if it is then #whoopwhoopwhoop - I've been wanting to get something like this working for months


Support for local SQLite datasources

Posted: Tue May 21, 2013 7:21 pm
by Dan Sweeney

Hi Katya
That's sorted that thanks. I'm still having problems mapping the array to my list.
I've set the mobilelistitem to the "ourFinalArray" and added one of the JSON fields and mapped this to a label but it doesn't seem to be mapping.
What am I missing?


Support for local SQLite datasources

Posted: Tue May 21, 2013 7:38 pm
by Kateryna Grynko

Hi Phil,

WebSQL you want to use doesn't allow you to open custom file with database. You can only export database to SQL script using the command ".dump" (http://www.sqlite.org/sqlite.html), and then import data executing each line from SQL script using the function "executeSql".

Why don't you want to use Database backend for storing data?


Support for local SQLite datasources

Posted: Tue May 21, 2013 7:39 pm
by Kateryna Grynko

Скажи, что WebSQL, которым он хочет воспользоваться, не позволяет открывать произвольный файл с базой данных. Можно только экспортировать базу данных в SQL скрипт командой ".dump" (http://www.sqlite.org/sqlite.html), а затем импортировать данные, выполняя каждую строку из SQL скрипта с помощью функции executeSql


Support for local SQLite datasources

Posted: Tue May 21, 2013 7:40 pm
by Kateryna Grynko

Hi Dan,

Could you please give us screen shot of your Response mapping?


Support for local SQLite datasources

Posted: Tue May 21, 2013 8:09 pm
by ApperyAmateur

OK no problem, My current workaround is using images of the contents of database, a bit crappy though :s

I did use database backend at first but my app is a reference/revision app for students and they don't have access to either 3G or the net in college, which renders the app useless :(


Support for local SQLite datasources

Posted: Wed May 22, 2013 12:09 pm
by Maryna Brodina

Hi Phil! You should be able to store images in DB. Do you have any problem with that?


Support for local SQLite datasources

Posted: Wed May 22, 2013 12:20 pm
by ApperyAmateur

It's OK now, I havent solved the problem but have a different version.

Marina - My original idea was to access an offline database holding text but now instead I have taken screenshots of that text and uploaded an image to each page instead, not using databases.

Hopefully accessing an offline database will come soon but I'll cope for the time being.


Support for local SQLite datasources

Posted: Wed May 22, 2013 1:14 pm
by Maryna Brodina

If you have some set of texts why don't you use localStorage where you can store up to 5 MB instead of using screenshots. You can create JS asset where you save data in localStorage variables, or create Generic service (here is more information https://getsatisfaction.com/apperyio/...)


Support for local SQLite datasources

Posted: Thu Jun 27, 2013 2:27 pm
by Neel Suresh Sus

Is there a tutorial video on how to setup a SQLLite DB within an appery app and then populate with data from a cloud db and then have it push back to forms or to the cloud db? Ideally with the visual mapper?