Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a new DatabaseInitializationMode correspond to AutoConfigureTestDatabase.Replace.NON_TEST #44702

Open
quaff opened this issue Mar 13, 2025 · 5 comments
Labels
for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged

Comments

@quaff
Copy link
Contributor

quaff commented Mar 13, 2025

We should introduce a new mode which include EMBEDDED and test databases, and make it as default mode.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 13, 2025
@Bibekjoshi50

This comment has been minimized.

@Bibekjoshi50

This comment has been minimized.

@wilkinsona
Copy link
Member

wilkinsona commented Mar 13, 2025

It would feel a little odd to have a NON_TEST-like value that is used in main code. What would be the benefit?

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Mar 13, 2025
@quaff
Copy link
Contributor Author

quaff commented Mar 13, 2025

Users would expect schema initialization for test or demo project that running database in container via testcontainers or docker compose.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Mar 13, 2025
@wilkinsona
Copy link
Member

I'm not sure that they would. We see the use of Testcontainers or Docker Compose as a way of running/testing your app in a more production-like way. In such a situation, the expectation is that schema initialisation is handled just as it is in production. For that case, the proposed change would be a breaking one as it would become necessary to change configuration otherwise two attempts would be made to initialise the schema.

I think the current distinction between embedded and non-embedded databases is the better one here as it feels consistent with our position of Testcontainers and Docker Compose. As such, I am against changing the default.

Setting reservations about a NON_TEST-like value in main code aside for now, we could consider introducing a new value that you choose to set but I'm not sure it's something that we've seen much need for. This is the first such request that I can recall. Let's see what the rest of the team thinks.

@wilkinsona wilkinsona added for: team-attention An issue we'd like other members of the team to review and removed status: feedback-provided Feedback has been provided labels Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

4 participants