peterldowns / pgtestdb

quickly run tests in their own temporary, isolated, postgres databases
MIT License
163 stars 13 forks source link

Add a migrator for uptrace/bun #8

Closed BrynBerkeley closed 3 months ago

BrynBerkeley commented 5 months ago

This adds a migrator for uptrace/bun. Like golangmigrator, it only supports SQL file migrations as discussed in #7 .

peterldowns commented 5 months ago

This looks great! I'll give a final review within a day or two, but on first glance I think this is shippable. Can you confirm that you've used this for your migrations and it's all good?

Thanks so much for the contribution :)

BrynBerkeley commented 5 months ago

I've tested this locally, and it works and mostly suits my needs. This migrator is a slight modification of the one I've been using for projects.

In my projects, I've needed to run go-based migrations alongside the SQL ones for some of my tests. So I allowed passing go migrations through to the migrator, but their hashes ended up being just the name of the go file. I just had to be mindful that the database template wouldn't reflect any of the changes made in the go migration, but it's a source of confusion, so I haven't included it here.

peterldowns commented 3 months ago

Tests and docs look great, thank you again for contributing!