I wonder, is it possible to create sqlite3_value * from scratch
        from within SQLite library's user code?

        The idea is as follows.  The current dbtriv.c [1] code has a
        db_triv_exec_bound () function, used roughly as follows:

   /* sqlite3 *db; */
   const char *sql
     = ("INSERT INTO foo (bar, baz)"
        " VALUES ($1, $2);");
   int r
     = db_triv_exec_bound (db, sql,
                           SQLITE_INTEGER, (sqlite3_int64)1,
                           SQLITE3_TEXT,   -1, "qux",
                           -1);
   assert (r == SQLITE_OK);

        This function will look up a cached prepared statement for the
        SQL code passed, creating and caching one if none's found, and
        then bind the parameters with sqlite3_bind_int64 (),
        sqlite3_bind_text (), etc., matching the type specifiers passed.

        Given some way to construct a sqlite3_value wrapping object, I
        could instead rely on sqlite3_bind_value () alone, thus
        eliminating the necessity of type specifiers in the interface.

        TIA.

[1] https://gitorious.org/e2dis/e2dis-devel/blobs/master/lib/dbtriv.c

-- 
FSF associate member #7257

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to