Re: [sqlite] Sqlite catalog - datebase with pictures

2008-03-30 Thread lukasz p.


Martin Engelschalk wrote:
 
 Hello Lukasz,
 
 to insert a picture (or any binary data for that matter), you can read 
 the data from the file and use sqlite3_bind_blob to insert (or update) it.
 When selecting it from the database, use sqlite_column_blob to retrieve 
 the data and sqlite3_column_bytes to get the length.
 
 An alternative is to convert the binary data to a string before storing 
 it in the database. For this you can use base64 - encoding or sonething 
 like this.
 
 See
 http://www.sqlite.org/capi3ref.html#sqlite3_bind_blob
 http://www.sqlite.org/capi3ref.html#sqlite3_column_blob
 and the sqlite3_blob* - functions.
 
 On how to design your database, that would depend on what you are 
 planning to to and how to use the data. Perhaps you could provide more 
 information.
 
 Hope this helps,
 Martin
 
 lukasz p. wrote:
 Hi.
 I would like to write an application wich helps me to manage with my
 cd/dvd
 collections. It will scan all files on cd/dvd add it to a datebase and it
 could also insert pictures (cd/dvd covers). My questions are:
 - is there any possiblity to add in sqlite datebase pictures like gif,
 jpg ?
 - how to design datebase to scan cd/dvd and make tree layout (Folders,
 files
 etc.) ?
 Thx for any sugestions.
   
 
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 

Thx for help Martin.
When I'm scanning my CD/DVD for a files I'll scan all path to it for
example: 
\etc\lilo.conf
\etc\x11\xorg.conf
and after that I'll be creating tree layout in application, but I don't know
is it a good idea maybe  there is something simpler. How to keep those data
in datebase ? Could it be a blob or string?
-- 
View this message in context: 
http://www.nabble.com/Sqlite-catalog---datebase-with-pictures-tp16369126p16380197.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Sqlite catalog - datebase with pictures

2008-03-29 Thread lukasz p.

Hi.
I would like to write an application wich helps me to manage with my cd/dvd
collections. It will scan all files on cd/dvd add it to a datebase and it
could also insert pictures (cd/dvd covers). My questions are:
- is there any possiblity to add in sqlite datebase pictures like gif, jpg ?
- how to design datebase to scan cd/dvd and make tree layout (Folders, files
etc.) ?
Thx for any sugestions.
-- 
View this message in context: 
http://www.nabble.com/Sqlite-catalog---datebase-with-pictures-tp16369126p16369126.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users