Node-sqlite3: Error: SQLITE_ERROR: near "AUTO_INCREMENT": syntax error

Created on 1 Aug 2016  路  1Comment  路  Source: mapbox/node-sqlite3

id INTEGER NOT NULL AUTO_INCREMENT,

Does not work like standard SQL

How has anyone else setup a primary key with auto increment?

This is what I did,

CREATE TABLE sample (id INTEGER NOT NULL AUTO_INCREMENT, column2 TEXT, PRIMARY KEY('id'))

with auto increment, works just fine.

Thoughts?

Most helpful comment

Please try CREATE TABLE sample (id INTEGER PRIMARY KEY AUTOINCREMENT, column2 TEXT).

>All comments

Please try CREATE TABLE sample (id INTEGER PRIMARY KEY AUTOINCREMENT, column2 TEXT).

Was this page helpful?
0 / 5 - 0 ratings