SQLite JDBC driver

Connect Scriptella to SQLite using the built-in sqlite adapter and an external JDBC driver.

Install the JDBC driver

Download the official JDBC driver for Maven coordinate org.xerial:sqlite-jdbc:3.53.4.0. Place sqlite-jdbc-3.53.4.0.jar in a lib/ directory next to your ETL file.

JDBC class org.sqlite.JDBC. The example below shows the JDBC URL format.

Check the connection

Use an existing database file and replace the absolute path. Save this as check.etl.xml, then run scriptella.sh check.etl.xml. The read-only query passes the connection_ok column to the nested script, which prints CONNECTION OK: 1.

<?xml version="1.0"?>
<!DOCTYPE etl SYSTEM "http://scriptella.org/dtd/etl.dtd">
<etl>
    <connection id="db" driver="sqlite"
                url="jdbc:sqlite:/absolute/path/source.db"
                classpath="lib/sqlite-jdbc-3.53.4.0.jar"/>
    <connection id="console" driver="text"/>
    <query connection-id="db">
        SELECT 1 AS connection_ok;
        <script connection-id="console">CONNECTION OK: $connection_ok</script>
    </query>
</etl>

Installation instructions · Download Scriptella

Verified with Scriptella 1.7.0

File-backed SQLite 3.53.4 (Xerial bundled engine) with JDBC driver 3.53.4.0. The release-candidate test suite used a real temporary database file and checked alias and URL selection, schema creation, reads and writes, representative values, persistence, commit, and rollback.

Compatibility evidence · Release-candidate CI · SQLite to PostgreSQL sample

Configuration notes

Check that the path exists before running a migration. SQLite can create a database at a missing path. High-precision NUMERIC/REAL values can round. Store exact decimals as TEXT and convert explicitly at the destination.

Adapter Javadoc