Configuring the datasource
Datasource
You can find all the information about how to configure a datasource in Quarkus in the official Quarkus documentation.
The db-kind
used by this extension is sqlite
so a configuration defining a default SQLite datasource looks like:
quarkus.datasource.db-kind=sqlite
quarkus.datasource.jdbc.url=... (1)
1 | See below for SQLite JDBC URLs. |
JDBC URL
SQLite only runs as an embedded database.
You can specify connection details using the JDBC URL, or use the defaults.
An SQLite JDBC URL looks like the following:
jdbc:sqlite:[path]/[name][?key=value…]
- Example
-
jdbc:sqlite:/home/user/mydatabase.db
SQLite also supports in-memory database management, which does not create any database files. To use an in-memory database, specify the following JDBC URL:
jdbc:sqlite::memory:
The official documentation and URI Examples go into more details and list optional parameters as well.