title: SQLite - Foreign Keys Contraints - IOs 5
body: <p>it seems that Foreign Keys Constraints are supported since version 3.6.x in SQLite. The version of SQLite on IOS5.0 is 3.7.7 (found in sqlite3.h).</p>
  
  <p>But when I try to insert a row in a table that has a constraint, my row is correctly inserted even if the related foreign key is not existing. I have no error.</p>
  
  <p>Doing the same insert statement using apps like Navicat gives me a "Constraint violation error"</p>
  
  <p>Do you know if foreign keys are supported on IOs 5 ?</p>
  
  <p>Here is the Database Schema:</p>
  
  <pre><code>CREATE TABLE artist(
    artistid    INTEGER PRIMARY KEY, 
    artistname  TEXT
  )
  
  CREATE TABLE "track" (
       "trackid" INTEGER PRIMARY KEY AUTOINCREMENT,
       "trackname" TEXT,
       "trackartist" INTEGER,
      CONSTRAINT "trackartist" FOREIGN KEY ("trackartist") REFERENCES "artist" ("artistid") ON DELETE CASCADE ON UPDATE CASCADE)
  </code></pre>
  
  <p>Really simple, isn't it ?</p>
  
  <p>Thanks
  Emmanuel</p>