[Digikam-users] sql queries digikam
depot @ xs4all. nl
depot at xs4all.nl
Mon Jul 2 20:02:42 BST 2007
> > Hi Arnd. Thanks a lot again!
> > I did as you suggested. Even though I don't understand what your code does.
>
> OK, a bit of explanation is needed:
> The above command will output a string (through the Warning handler)
> to the konsole which will start with
> QUERY
> and then the actual sqlite query string.
> So you have to look for lines with QUERY ...
Thanks, that's clear now.
>
> > Still it's not what I am looking for.
>
> Yep, you will have to do a search and look for lines
> which have the text "QUERY" in them,
> but they will only appear if you do a search.
>
> > Maybe I was not clear enough with my question. Let me rephrase it.
>
> Your question was crystal clear - we will get there ...
>
> >
> > If there was a way to monitor all communication from digikam to sqlite3 then it would be easy
> > to find out.
> >
> > Anyone?
>
> Hej, don't give me up to quickly:
Not at all, I am counting on you! Your answers have been very helpful.
>
> I just added the two kdWarning()
> So that the code looks like
> ...
> kdWarning() << "QUERY" << sqlQuery << endl;
> if (!m_db.execSql(sqlQuery, &values))
> ...
>
> This gives me for example:
>
> kio_digikamsearch: WARNING: QUERYSELECT Images.id, Images.name,
> Images.dirid, Images.datetime, Albums.url FROM Images, Albums LEFT JOIN
> ImageProperties ON Images.id = Imageproperties.imageid WHERE ( (Images.id
> IN (SELECT imageid FROM ImageTags WHERE tagid IN (SELECT id FROM
> Tags WHERE name NOT LIKE '%A%'))) ) AND (Albums.id=Images.dirid);
>
> Does this look better for you?
Perfect! That is what I was aiming at. Now I can use these queries as examples for custom command
line sqlite3 queries on my digikam3.db.
>
> Well, clearly,
> kdWarning() << "QUERY: " << sqlQuery << endl;
> if (!m_db.execSql(sqlQuery, &values))
> would have been better (i.e. to have a bit of space before
> the actual query.
>
> HTH, Arnd
>
Thanks again. I will rebuild digikam tomorrow. Am not at my machine right now.
Regards,
Jeroen
jeroen.leijen.net/photography
More information about the Digikam-users
mailing list