From 206a24b5a44d14c5fb8d82406d1e62974b43a3e0 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Wed, 3 Jan 2024 23:47:27 +0100 Subject: [PATCH] Update --- build.gradle.kts | 2 +- .../example/demo/controllers/UsersController.kt | 2 +- src/main/resources/application.properties | 14 ++++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 1dbb34f..a2d5cf9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -28,8 +28,8 @@ dependencies { // For DB implementation("io.quarkus:quarkus-hibernate-orm:3.6.4") implementation("io.quarkus:quarkus-hibernate-orm-panache-kotlin:3.6.4") - implementation("io.quarkiverse.jdbc:quarkus-jdbc-sqlite:3.0.7") implementation("io.quarkus:quarkus-hibernate-validator:3.6.4") + implementation("io.quarkiverse.jdbc:quarkus-jdbc-sqlite:3.0.7") developmentOnly("org.springframework.boot:spring-boot-devtools") testImplementation("org.springframework.boot:spring-boot-starter-test") diff --git a/src/main/kotlin/com/example/demo/controllers/UsersController.kt b/src/main/kotlin/com/example/demo/controllers/UsersController.kt index 393461e..c8a56df 100644 --- a/src/main/kotlin/com/example/demo/controllers/UsersController.kt +++ b/src/main/kotlin/com/example/demo/controllers/UsersController.kt @@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.* class UsersController { @GetMapping("/users") fun index(): List { - return User.findAll().list() + return User.listAll() } @GetMapping("/users/{id}") diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index a38f6ec..792fa0d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,8 +1,14 @@ # configure your datasource quarkus.datasource.db-kind=sqlite -quarkus.datasource.username= -quarkus.datasource.password= -quarkus.datasource.jdbc.url=jdbc:sqlite:///test.db +quarkus.datasource.jdbc.url=jdbc:sqlite::memory: + +#%prod.quarkus.datasource.db-kind=postgresql +#%prod.quarkus.datasource.username=quarkus_test +#%prod.quarkus.datasource.password=quarkus_test +#%prod.quarkus.datasource.jdbc.url=jdbc:postgresql://localhost/quarkus_test +#%prod.quarkus.datasource.jdbc.max-size=8 +#%prod.quarkus.datasource.jdbc.min-size=2 # drop and create the database at startup (use `update` to only update the schema) -quarkus.hibernate-orm.database.generation=update \ No newline at end of file +quarkus.hibernate-orm.database.generation=update +quarkus.hibernate-orm.log.sql=true \ No newline at end of file