pointer-passing interface, and testing if pointer is correct 'type'....

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

pointer-passing interface, and testing if pointer is correct 'type'....

dave
Folks;
 
I have a v-table using the pointer-passing interface, and binding 'null' is
a valid use-case.  However, to wit there is no way to tell on the v-table
implementation side if the sqlite3_value_pointer() returns 'null' because
that is what the user explicitly and validly chose, or because they
specified the wrong 'pointer type string'.  As it is, I can't emit useful
error messages to developers in that case.
 
If there is a method of differentiating 'null because you want it', and
'null because you can't have it', please advise.
 
Outside of that, I would suggest as a future enhancement possibly:
*  int sqlite_isvalid_pointer(sqlite3_value*, const char*)
  returns a 'boolean' indicating it was bound validly or not
or if doing two validations (one for the test, one for the value retrieval)
is unappealing, maybe:
*  void *sqlite3_value_pointer_v2(sqlite3_value*, const char*, int*);
  gets pointer as per usual, and if final parameter is non-null, provide a
'boolean' indicating that it was validly bound.

Thanks!
-dave
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users