On 27/04/2009 8:35 PM, Vinnie wrote: > I've made my own wrapper class around sqlite for executing database commands. > Its completely generic and supports the use of binds and parameter > substitution through the use of variable arguments (<stdarg.h>) as well as a > printf-style format string that clues the routine into the types of the > arguments. For example: > > I'm pretty sure this is not an original idea
You're not wrong. > so what I would like to know is, has anyone done anything similar? Or come up > with different solutions to the problem of putting a suitable wrapper around > SQlite? Or are there any third party libraries that have done something like > this? > > I would love to see other people's approach, Reading through this lot should keep you out of trouble for a while: http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers > I'm hoping to pick up some ideas that will make this system better. Because > while it is a nice improvement over straight sqlite it is not without its > problems. The format string is prone to making mistakes especially when > modifying statements and adding more columns or parameters. And sometimes it > is silly seeing "(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" in an > INSERT statement. Once in a while I forget to add a ? and it becomes a hard > to track bug. HTH, John _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users