title: sqlite integer primary key not null constraint failed
body: <p>According to the SQLite documentation / FAQ a column declared <code>INTEGER PRIMARY KEY</code> will automatically get a value of +1 the highest of the column if omitted.<br>
  Using SQLite version 3.22.0 2018-01-22 18:45:57<br>
  Creating a table as follows:</p>
  
  <pre><code>CREATE TABLE test (
     demo_id INTEGER PRIMARY KEY NOT NULL,
     ttt VARCHAR(40) NOT NULL,
     basic VARCHAR(25) NOT NULL,
     name VARCHAR(255) NOT NULL,
     UNIQUE(ttt, basic) ON CONFLICT ROLLBACK
     ) WITHOUT ROWID;
  </code></pre>
  
  <p>Then inserting like this:</p>
  
  <pre><code>INSERT INTO test (ttt, basic, name) VALUES ('foo', 'bar', 'This is
   a test');
  </code></pre>
  
  <p>gives:</p>
  
  <pre><code>Error: NOT NULL constraint failed: test.demo_id
  sqlite&gt;
  </code></pre>
  
  <p>When it is expected to create a record with a demo_id value of 1. Even if the table already contains values, it'll fail inserting the row without explicitly specifying the id with the same error.</p>
  
  <p>What am I doing wrong?</p>