> On Feb 5, 2020, at 9:58 AM, Keith Medcalf <kmedc...@dessus.com> wrote:
> 
> It seems that "column affinities" are not respected in Virtual Table 
> implementations -- that is the value that is returned is the datatype 
> provided by the the vtab_cursor sqlite3_result_* function and the "column 
> affinity" from the vtab declaration is not applied.

The vtab implementation is responsible for generating the CREATE TABLE 
statement and passing it to sqlite3_declare_vtab(). It’s also responsible for 
returning column values. So I think the assumption is that it’s up to the 
implementation to be self-consistent, i.e. returning column values that match 
the declaration.

I haven’t used the CSV vtable. It looks as though its CREATE VIRTUAL TABLE 
statement takes a ‘schema’ parameter containing the SQL table declaration, that 
it then passes straight through to sqlite3_declare_vtab(). It probably doesn’t 
parse that declaration or figure out from it what the declared types of the 
columns are.

In other words this looks like a limitation of the CSV implementation, which is 
perhaps unusual in that it is not in control of the table schema it declares.

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

Reply via email to