From 34115b084cf51c2bbdf45c6404c8a46901519905 Mon Sep 17 00:00:00 2001 From: Manuel Soulier Date: Fri, 27 Oct 2023 15:14:08 +0200 Subject: [PATCH] fix: fix zonky attempt --- .../test/java/fr/insee/arc/utils/query/TestDatabase.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arc-utils/src/test/java/fr/insee/arc/utils/query/TestDatabase.java b/arc-utils/src/test/java/fr/insee/arc/utils/query/TestDatabase.java index 51242f91f..cfccb4992 100644 --- a/arc-utils/src/test/java/fr/insee/arc/utils/query/TestDatabase.java +++ b/arc-utils/src/test/java/fr/insee/arc/utils/query/TestDatabase.java @@ -4,6 +4,7 @@ import java.sql.Connection; import java.sql.SQLException; +import fr.insee.arc.utils.dao.GenericPreparedStatementBuilder; import fr.insee.arc.utils.dao.UtilitaireDao; import fr.insee.arc.utils.exception.ArcException; import io.zonky.test.db.postgres.embedded.EmbeddedPostgres; @@ -21,11 +22,12 @@ private static Connection instanciateTestDatabase() connection = pg.getPostgresDatabase().getConnection(); String user = connection.getMetaData().getUserName(); - + String database = UtilitaireDao.get(0).getString(connection, new GenericPreparedStatementBuilder("select current_database()")); + System.out.println("§§§§§§§"); System.out.println(user); - UtilitaireDao.get(0).executeImmediate(connection, "GRANT CREATE ON DATABASE current_database() TO "+user+";"); + UtilitaireDao.get(0).executeImmediate(connection, "GRANT CREATE ON DATABASE "+database+" TO "+user+";");