Introduction
Is it possible to use SQLite with Hibernate and Quarkus?
Yes it is! But native build is currently not supported!
- Add library-dependencies to your Quarkus-Project
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.34.0</version>
</dependency>
<dependency>
<groupId>com.github.gwenn</groupId>
<artifactId>sqlite-dialect</artifactId>
<version>0.1.2</version>
</dependency>
2. Edit your application.properties
quarkus.datasource.db-kind = other
quarkus.datasource.jdbc.driver=org.sqlite.JDBC
quarkus.hibernate-orm.dialect=org.sqlite.hibernate.dialect.SQLiteDialect
quarkus.datasource.jdbc.url=jdbc:sqlite:./mydatabase.db
%dev.quarkus.datasource.jdbc.url=jdbc:sqlite::memory:
%test.quarkus.datasource.jdbc.url=jdbc:sqlite::memory:
%dev.quarkus.hibernate-orm.database.generation = drop-and-create
That's it!

No comments:
Post a Comment