Re: VTable Column Affinity Question and Change Request

Jens Alfke <jens-mAcipnqRhZf2eFz/[email protected]>
Newsgroups gmane.comp.db.sqlite.general
Message-ID <[email protected]>

> On Feb 5, 2020, at 6:56 PM, Keith Medcalf <[email protected]> wrote:
> 
>> It probably doesn’t parse that declaration or
>> figure out from it what the declared types of the columns are.
> 
> Actually it does, and this is documented for the sqlite3_declare_vtab function -- and in fact the column names and affinities are parsed and stored in the internal Table schema.  

Sorry, I meant that the _CSV extension_ doesn't parse the 'CREATE TABLE…' declaration to figure out what column affinities the caller desires.

SQLite probably stores the column affinities so they can be returned from APIs that request them; IIRC isn't there a C API call that tells you the affinity of a column?

> The column names are used but the executed VDBE program does not "apply affinity".

I suspect this is for the same reason that led to the immediate objections to your proposal: it could hurt performance.

I think your proposal makes sense given that it doesn't slow anything down if the extension didn't specify any column affinities. My virtual table doesn't.

—Jens
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.