-
Notifications
You must be signed in to change notification settings - Fork 19
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
add initial loading of facts at startup to the container image located in a specific directory #2062
Comments
doesn't this help? https://www.baeldung.com/spring-boot-data-sql-and-schema-sql |
you'll probably want to control it per test, not per container |
Edit: Turns out this is not an option, as it would execute before liquibase, so that the schema to insert into would not be there. |
But in order to create a fixture, isn't it nicer to publish a bunch of facts via the API ? I feel like this is much more maintainable than having a script with Json (or sql script with INSERTS with json strings) lying around... Maybe i do not understand the usecase enough. |
actually not, since I do not want to execute specific tests but rather startup a full environment (stage) locally. For this, I need a factcast server (of course with a DB behind) and a DB for the read model. Within this setup it would be useful to fill the eventstore with data/facts that the locally started app can consume to create the read-model. If I need to use the API then I need to write some extra code to achive this, but maybe the easiest path is to create an sql-insert script to fill the "fact" table? Still the escaping is always a cumbersome there... |
That's what i mean: if you publish via API from java, you can get rid of escaping or even writing any json. Isn't that easier to do? |
any feedback on this @sschmiedleitner ? One collegue did a @BeforeMethod reading a stream from disk (with unescaped headers & payloads) and used |
no satisfying workarounds for me. but nevermind you can also drop that. It would have just been helpful and nice to have. But not critical for me for now. |
when creating a dev env locally, it would be useful to easily setup a factcast server using containers. There is the factcast/factcast image that can be used in unit tests very well, but additionally to that it would be useful, if facts could be loaded from disc during startup automatically as well.
Let's say there is a specific folder in the image /auto-import where a user may add json files (i.e. using volume mapping).
basic json structure proposal:
If the folder is empty do not import anything at all (which should be the default in the built image).
The text was updated successfully, but these errors were encountered: