Scala Slick and SQLite Scala Slick and SQLite sqlite sqlite

Scala Slick and SQLite


JDBC relies on drivers that implement the JDBC API, and provide access to the low-level functionality of working with particular databases.

URLs are how you tell a JDBC driver which database you want to connect to. The first part of the URL is always jdbc:<driverId>:, where driverId is the specific name that the driver expects to see (e.g. postgresql, mysql or, in your case sqlite.) The format of the URL after the driver ID is specific to the particular driver implementation. With mysql and postgres, where you typically connect over TCP to the database server, you'll see a format like this:

jdbc:mysql://dbserver:dbport/databaseNamejdbc:postgresql://dbserver:dbport/databaseName

But, since SQLite is an in-process, local database, the part of the URL after the driver ID is just a filesystem path, like so:

jdbc:sqlite:/home/me/my-db-file.sqlite