Want more control over your database deployments? – Find out how with Carlos Robles at Redgate Summit Register now

Flyway Documentation

SQLite

Supported Versions

  • 3.7 and later 3.x versions

Support Level

Compatible
Certified
Guaranteed Flyway Teams

Support Level determines the degree of support available for this database (learn more).

Drivers

Java (Xerial) Android (SQLDroid)
URL format jdbc:sqlite:database jdbc:sqlite:database
Ships with Flyway Command-line Yes No
Maven Central coordinates org.xerial:sqlite-jdbc:3.30.1 org.sqldroid:sqldroid:1.1.0-rc1
Supported versions 3.7 and later 1.1.0-rc1 and later
Default Java class org.sqlite.JDBC org.sqldroid.SQLDroidDriver

SQL Script Syntax

Compatibility

  • DDL exported by SQLite can be used unchanged in a Flyway migration
  • Any SQLite SQL script executed by Flyway, can be executed by the SQLite tools (after the placeholders have been replaced)

Example

/* Single line comment */
CREATE TABLE test_data (
  value VARCHAR(25) NOT NULL PRIMARY KEY
);

/*
Multi-line
comment
*/

-- Sql-style comment

-- Placeholder
INSERT INTO ${tableName} (name) VALUES ('Mr. T');

CREATE TRIGGER update_customer_address UPDATE OF address ON customers
  BEGIN
    UPDATE orders SET address = new.address WHERE customer_name = old.name;
  END;

Limitations

  • No concurrent migration as SQLite does not support SELECT ... FOR UPDATE locking
  • No support for multiple schemas or changing the current schema, as SQLite doesn’t support schemas
  • No support for CREATE TRANSACTION and COMMIT statements within a migration, as SQLite doesn’t support nested transactions

Firebird