On Tue, 2015-02-10 at 16:11 +0000, Philip Withnall wrote:
> Problems building SQL and SPARQL queries
>  • https://bugzilla.gnome.org/show_bug.cgi?id=741777
>  • SQLite: can’t think of a decent way of fixing this

libgda has the GdaSQLBuilder API. It's a bit odd, but it works, and
handles different SQL dialects:
https://developer.gnome.org/libgda/stable/GdaSqlBuilder.html#GdaSqlBuilder.description

I think it's a bit nicer in the (my) C++ wrapper, though it's
documentation there is a bare minimum:
https://developer.gnome.org/libgdamm/unstable/classGnome_1_1Gda_1_1SqlBuilder.html#details

I use the C++ version lots in Glom.

At the least, it's a big help to avoid SQL injection that can creep in
when you just concatenate strings.

I would never use any database API without using some abstraction layer
such as libgda. They are all far too strange. I'd rather port one day
from one sane abstraction layer to another sane abstraction layer than
from some gnarly specific database API to one that's just gnarly in
another way.

-- 
Murray Cumming
[email protected]
www.murrayc.com

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
desktop-devel-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/desktop-devel-list

Reply via email to