Hi,

As part of my GSoC project I'm working on a modern safe C++ API. An
initial version can be seen at libdrizzle/libdrizzle.hpp. Drizzletest
already uses this. This implements part of the automatic resource
management.
Another important part is building queries in a safe and easy way. It
should be easy to use and hard to misuse.

A wrapper I wrote before uses syntax like this:
Csql_query q(con, "select * from users where uid = ?");
q.p(uid);
q.execute();

Csql_query(con, "select * from ? where name =
?").name("users").p(name).execute();

The 'format' argument contains placeholders '?'. Each call to p()
replaces a placeholder, while automatically performing escaping and
quoting based on argument type.
name() can be used for names (using ` quotes) and raw() can be used to
skip escaping and quoting.
This syntax is simple and safe and I'd like to add it to the Drizzle
client lib.

What are your opinions on this?
-- 
Olaf

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to