Reply
Thread Tools
Posts: 10 | Thanked: 0 times | Joined on Feb 2009
#1
Hello fellow developers
I am working on a car tracking program (its main purpose is to track expenses on gas, trips, repairs, tire changes etc) and I am considering using SQLite3 db as a source for user data. I would like to hear from some of you who have used SQLite a few tips on how to do that.

First thing is if SQLite is preinstalled on maemo devices or if I should make it a prerequisite.
Then some questions about usage. I would like to know what should I include to use SQLite in my program (if sqlite3.h is ok?)?
Also I would like to know if this kind of behaviour is correct with SQLite.
First open connection to a db stored at fixed position in the filesystem. Then read data from db, add, eventually modify or delete them. Last close connection. This should be workflow of an application. I want to keep it as simple as possible that is why db is going to be stored on fixed position. Also I am going to have just two tables (cars table and events table for each car). I would like to know if data is stored automaticly after each statement so that I do not have to worry about power or other failures. Also I would also appreciate your advice on how to filter through data set fetched after select. Other operations are good for me because they are just the matter of good sql statement, but how do I go through SELECT * FROM table?
This is just for the begining and I am looking forward to hearing from you who are more experienced than me in this field and maybe broaden my horizons

PS: sql language and understanding of a programming concepts are not a problem as I am currently working on my bachelor thesis (see above ) I just would like to here some technical details
PS2: if you think that usage of sqlite is bad decision and know something more suitable (maybe other db like berkeleydb or whole different approach) I would like to here from you too

Have a nice day and thank you very much

Johnnnie
 
Posts: 432 | Thanked: 645 times | Joined on Mar 2009
#2
Hi Johnnnie,

I will try to answer your question as far as I can. First of all, have you already decided in which language you will write your application? I implemented some python applications, as well on top of sqlite, with the python bindings for sqlite. With python you can build as well easily a GUI, by combining it with the python bindings for QT. Here are mentioned some tutorials and information about it.

Then the general questions about sqlite,

1) I am pretty sure that sqlite comes with the device directly, but I will prove that and give you a definite answer tomorrow

2) yes, in sqlite u work on a database which is placed as a file somewhere on the file-system

3) In python you need to call a commit method after manipulating the database

4) you can do a lot more within the SQL statement. would do as much as possible directly on the database instead of getting the whole set and sorting afterwards

Now some general tutorials, which might help u:

-> sqlite tutorial

-> Python bindings for sqlite

Hope this helped you a bit,

Daniel
 
Posts: 10 | Thanked: 0 times | Joined on Feb 2009
#3
Hello Daniel

At the begining thank you for your time.
According to selection of a programming language. I decided to use c99 C with a companion of standard gui (hildon).
Looks like I am going to play a lot with SQL statements to make them work for me as much as possible
I have just one more question. Do you by any chance know how to compile source? I mean how to set compiler because while I was using libxml2 I compiled using this command:
gcc `xml2-config --cflags --libs` -o Build/maemo maemo.c
I am particulary looking for part like this: `xml2-config --cflags --libs`
if there is something for sqlite or normal compile is sufficient.
Thanks in advance

Johnnnie
 
Posts: 243 | Thanked: 172 times | Joined on Sep 2007 @ silicon valley
#4
gpe uses sqlite3 as a backend, and it is all gtk/c. Hope that helps.
 
Reply


 
Forum Jump


All times are GMT. The time now is 23:12.