Re: [sqlite] PRAGMA table_info and not nullable rowid alias

2017-07-16 Thread petern
That's interesting.  Apparentely PRAGMA table_info() reports the declared
column type not the operational column type.

sqlite> CREATE TABLE test (id INTEGER PRIMARY KEY NOT NULL);
Run Time: real 0.454 user 0.00 sys 0.00
sqlite> PRAGMA table_info(test);
cid,name,type,notnull,dflt_value,pk
0,id,INTEGER,1,,1





On Sun, Jul 16, 2017 at 12:19 AM, gwenn  wrote:

> Hello,
> PRAGMA table_info reports that a rowid alias is nullable:
>
> sqlite> .headers on
> sqlite> CREATE TABLE test (id INTEGER PRIMARY KEY);
> sqlite> pragma table_info("test");
> cid|name|type|notnull|dflt_value|pk
> 0|id|INTEGER|0||1
> sqilte> --0|id|INTEGER|1||1 expected
> sqlite> INSERT INTO test (id) VALUES (NULL);
> sqlite> SELECT rowid, id FROM test;
> id|id
> 1|1
>
> Regards.
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] PRAGMA table_info and not nullable rowid alias

2017-07-16 Thread gwenn
Hello,
PRAGMA table_info reports that a rowid alias is nullable:

sqlite> .headers on
sqlite> CREATE TABLE test (id INTEGER PRIMARY KEY);
sqlite> pragma table_info("test");
cid|name|type|notnull|dflt_value|pk
0|id|INTEGER|0||1
sqilte> --0|id|INTEGER|1||1 expected
sqlite> INSERT INTO test (id) VALUES (NULL);
sqlite> SELECT rowid, id FROM test;
id|id
1|1

Regards.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users