embedded-database-spring-test icon indicating copy to clipboard operation
embedded-database-spring-test copied to clipboard

Feature proposal: Statements to initialize new connections

Open trecloux opened this issue 2 years ago • 1 comments

Hi all,

Existing connection pools available in spring boot have a common feature to launch some SQL statements to initialize new SQL connections.

This feature is available in spring boot using these properties:

  • spring.datasource.dbcp2.connection-init-sqls
  • spring.datasource.tomcat.init-s-q-l
  • spring.datasource.hikari.connection-init-sql

A sample usage is to set the connection TimeZone on PostgreSQL, that not possible with the driver connection properties.

As I understand it, embedded-database-spring-test injects it's own DataSource, so this feature is not available.

The proposal is to implement this feature as part of this library, would you be interested in a such feature ? I can start working on it if you think that it would fit,

trecloux avatar Apr 27 '22 07:04 trecloux

Hi @trecloux, that's a great idea. I'm definitely interested in this feature and I think I'm not the only one who would appreciate it. Unfortunately I'm quite busy right now, but if you prepare a pull request, I'll make time for a code review and release a new version. Help is always welcome.

tomix26 avatar May 02 '22 18:05 tomix26