title: How to insert using a sequence with Liquibase
body: <p>I would like to do a liquibase insert with the primary key being auto generated from the sequence defined in the database. The target database is HSQLDB.</p>
  
  <p>It works to do an insert specifying a value for the primary key</p>
  
  <pre><code>&lt;insert ...&gt;
     &lt;column name="TAG_ID" valueNumeric="2"/&gt;
  </code></pre>
  
  <p>I found this (admittedly older) <a href="http://forum.liquibase.org/topic/sequence-value-while-inserting-the-data-in-table" rel="nofollow">conversation about it</a> but the issue is still the same. The suggested fix doesn't work for HSQLDB.</p>
  
  <p>Looking at <a href="http://www.liquibase.org/documentation/column.html" rel="nofollow">the docs</a> I've tried some things like </p>
  
  <pre><code>&lt;column name="TAG_ID"  defaultValueSequenceNext="TAG_ID_SEQ" /&gt;
  
  &lt;column name="TAG_ID"  defaultValueSequenceNext="TAG_ID_SEQ.NEXTVAL" /&gt;
  
  &lt;column name="TAG_ID"  valueComputed="TAG_ID_SEQ.NEXTVAL" /&gt;
  
  &lt;column name="TAG_ID"  autoIncrement="true" /&gt;
  </code></pre>
  
  <p>but none of those put anything in the key when I do the insert (the insert fails on a null primary key).</p>
  
  <p>How does one accomplish this?</p>