quarkusio/quarkus

Support import.sql or similar facility for data population when not using Hibernate to create the schema

Open

#21,866 建立於 2021年12月1日

在 GitHub 查看
 (18 留言) (2 反應) (0 負責人)Java (2,464 fork)batch import
area/hibernate-ormarea/persistencegood first issuekind/enhancement

倉庫指標

Star
 (12,967 star)
PR 合併指標
 (平均合併 6天 4小時) (30 天內合併 325 個 PR)

描述

Description

If I am using JPA to create my schema through Hibernate, I can easily add test data by creating an import.sql file in my resources.

However if I switch to using Flyway with PostgreSQL dev services, there doesn't seem to be an easy to do this except creating some extra migrations which are just used for test.

In Spring Boot I can create a data.sql file in my resources, and I can configure Spring Boot to execute this regardless of how my schema was created or what database I am using.

I am aware of the TC_INITSCRIPT option for test containers - but this would not work for our CI builds on k8s where TestContainers is not used (and in addition there doesn't seem to be an easy way to configure this when using dev services - quarkus.datasource.devservices.properties.TC_INIT_SCRIPT is documented not to work).

Implementation ideas

No response

貢獻者指南