Skip to content

Commit

Permalink
fix: fix zonky attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolife999 committed Oct 27, 2023
1 parent 4dc1e6b commit 34115b0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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+";");



Expand Down

0 comments on commit 34115b0

Please sign in to comment.