Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm doing something similar. There are a few differences in addition to the ones mentioned that I ran into:</p> <ul> <li><p>in the newer versions of SQLite3 with the Xerial JDBC driver, foreign keys are indeed supported. SQLite supports inline foreign key constraint definition: <br>CREATE TABLE Blah (foreignId Integer REFERENCES OtherTable (id)); <br><br> MySQL (with InnoDB) will <em>accept</em> the same syntax, but won't actually enforce the constraint unless you use a separate FOREIGN KEY clause which explicitly names the foreign table and key column(s): <br> CREATE TABLE Blah (foreignId INTEGER, FOREIGN KEY foreignId REFERENCES OtherTable (id));</p></li> <li><p>old versions of the SQLite JDBC driver don't support Statement.RETURN_GENERATED_KEYS; fixed in newer Xerial drivers.</p></li> <li><p>the syntax for auto-incrementing keys differs; SQLite: (id INTEGER PRIMARY KEY ASC, ...); MySQL: (id INTEGER PRIMARY KEY AUTO_INCREMENT, ...)</p></li> <li><p>SQLite accepts n-way comma-delimited joins: <br> SELECT * FROM A, B, C ON (A.x = B.y AND B.y = C.z); <br><br> MySQL does not; the following works in both: <br> SELECT * FROM A INNER JOIN B ON A.x = B.y INNER JOIN C ON B.y = C.z;</p></li> <li><p>With respect to the type differences, a related annoyance with SQLite's JDBC drivers is that the same column can produce different types via ResultSet.getObject(.); for example, an Integer or a Long depending on the magnitude of the number contained.</p></li> <li><p>auto-incrementing keys in SQLite MUST be declared type INTEGER; in MySQL any numeric integer type works.</p></li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload