i creating table inside db.i created table , able insert data on table issue in table have 2 "id" columns created 1 .why 2 id column generate in table.
follow step generate issue :-
- click bottom right button (enter text in pop screen ).press "add" button .it generate row in "cases" table when inspect show 2 column of "id" why ?
here code http://codepen.io/anon/pen/ovpgop
db.transaction(function(tx) { tx.executesql('create table "cases" ("id" integer primary key autoincrement not null , "casename" varchar not null )'); })
it appears expected behaviour sqlite, technology underpinning web sql (which deprecated technology, btw).
from the docs:
if table contains column of type integer primary key, column becomes alias rowid. can access rowid using of 4 different names, original 3 names described above or name given integer primary key column. these names aliases 1 , work equally in context.
therefore, guess chrome devtools showing rowid
column using alias (id
), in addition alias column explicitly added (id
).
it seems don't need explicitly add id column web sql/sqlite. add 1 you, can refer using rowid
, _rowid_
or oid
in statement.
edit: here fork of codepen, updates , deletes correctly working.