[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/
From: |
Christof Petig |
Subject: |
Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch |
Date: |
Fri, 20 Jan 2006 16:12:35 +0100 |
User-agent: |
Mail/News 1.5 (X11/20060119) |
Vinzenz 'evilissimo' Feenstra wrote:
> We talked about it this night and decided not to give up the va_args.
> Instead we're using a struct now which helps us to identify the value.
> So we can now use SQLITE_STATIC as argument for sqlite3_bind_text and
> sqlite3_bind_blob and can figure out in the methode database::fetch what
> kind of parameter was given.
>
> The usage for now is:
> std::string query_ = "SELECT foo FROM bar where id = ?";
> execute(query(query_), text(id) );
>
> or
> execute( "SELECT foo FROM bar where id = ?", text(id) );
>
> There are to functions text() and blob()
I strongly feel that varargs is a bad choice for C++ programs, using
your proposed % syntax is much cleaner (as with L() and boost::format).
Christof
signature.asc
Description: OpenPGP digital signature
- [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Vinzenz 'evilissimo' Feenstra, 2006/01/19
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Christof Petig, 2006/01/19
- Message not available
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch,
Christof Petig <=
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Nathaniel Smith, 2006/01/20
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Timothy Brownawell, 2006/01/21
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Richard Levitte - VMS Whacker, 2006/01/21
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Nathaniel Smith, 2006/01/22
- [Monotone-devel] Copy-on-write not mandated! (Was: Typesafe VA_ARGS replacement for database::execute/fetch), Clemens Hintze, 2006/01/22
- Re: [Monotone-devel] Copy-on-write not mandated! (Was: Typesafe VA_ARGS replacement for database::execute/fetch), Nathaniel Smith, 2006/01/22
- Re: [Monotone-devel] Copy-on-write not mandated! (Was: Typesafe VA_ARGS replacement for database::execute/fetch), Patrick Mauritz, 2006/01/23
- Re: [Monotone-devel] Copy-on-write not mandated!, Petr Ovtchenkov, 2006/01/24
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Vinzenz 'evilissimo' Feenstra, 2006/01/21
- Re: [Monotone-devel] Typesafe VA_ARGS replacement for database::execute/fetch, Vinzenz 'evilissimo' Feenstra, 2006/01/21