testcontainers-rs-modules-community icon indicating copy to clipboard operation
testcontainers-rs-modules-community copied to clipboard

feat: implemented `Postgres::with_init_sql`

Open CommanderStorm opened this issue 1 year ago • 1 comments

Resolves #164

The implementation is a bit hacky, am open to better approaches or other feedback ^^

CommanderStorm avatar Aug 19 '24 21:08 CommanderStorm

Thank you for the contribution! ❤️ Left a couple of suggestions that could significantly expand the capabilities of the crate, but they need to be discussed and possibly postponed

DDtKey avatar Aug 20 '24 12:08 DDtKey

Now it's possible with with_copy_to:

         image.with_copy_to(
            "/docker-entrypoint-initdb.d/init.sql",
            include_bytes!("initdb.sql").to_vec(),
        )

Which I found simple enough. So we can actually provide a guidance and probably shortcut for it. May simplify work done here

DDtKey avatar Sep 25 '24 11:09 DDtKey

Yea that definitely cleans things up a ton. Thanks 🙏 Sorry for the lacking progress, I was on vacation for the last month and am still in a bit of a catch-up mode work wise.

=> This PR might take a few weeks before I can actually invest the time it deserves

CommanderStorm avatar Sep 25 '24 12:09 CommanderStorm