caminte icon indicating copy to clipboard operation
caminte copied to clipboard

User defined primary keys in sqlite3 table

Open GINUGEORGE opened this issue 9 years ago • 3 comments

I am creating a cloud application. The application involves maintaining a database and so i have designed a table with the following schema :

create table connectioninfo ( device_id integer primary key, date_updated integer not null, unique(device_id) );

The database used is sqlite3 and I am using caminte for performing database related operations. When I am trying to insert or update a record in the table, I am getting the following error :

{ [Error: SQLITE_ERROR: table connectioninfo has no column named id] errno: 1, code: 'SQLITE_ERROR' }

I don't have any field with name 'id' . Is it necessary to have a field with the name 'id' in each table ? Can't I have user defined auto increment primary keys ? If so, how ?

GINUGEORGE avatar May 21 '15 09:05 GINUGEORGE

I am pretty sure caminte creates an id column for you.

You might need to migrate your schema.

huttj avatar Jun 14 '15 21:06 huttj

I confirm Caminte creates an id column automatically

thibautrey avatar Jun 14 '15 21:06 thibautrey

i am having the same problem on postgresql. I can not save the object because i dont have an id column. Nothing is being done automatically.

guilhermeKodama avatar Mar 01 '16 21:03 guilhermeKodama