refinery icon indicating copy to clipboard operation
refinery copied to clipboard

Make `Migration::sql()` public

Open jess-sol opened this issue 3 years ago • 2 comments

Currently trying to implement sqlx::migrate::MigrationSource for refinery in order to use sqlx::test. As part of this, I need to translate refinery_core::runner::Migration to sqlx::migrate::Migration. It'd actually be a pretty simple mapping if refinery's Migration::sqlx() was public. As it stands I'm just manually reading the file as a hack, but it'd be much easier if there was a way to access a migration's sql.

I could see making it a separate trait or something, if you wanted to make it difficult to access by default; but having some sort of escape hatch for these types of use-cases would be nice.

jess-sol avatar Sep 26 '22 18:09 jess-sol

Hi, looking at it I cannot recall the reasoning for not making it public. So I'd say we can make it public? Do you want to submit a PR unsealing it?

jxs avatar Sep 26 '22 21:09 jxs

Awesome, just created a PR

Thanks!

jess-sol avatar Sep 27 '22 16:09 jess-sol

addressed with #249

jxs avatar Nov 26 '22 17:11 jxs