valderman / selda

A type-safe, high-level SQL library for Haskell
https://selda.link
MIT License
478 stars 58 forks source link

How to handle migrations selda #171

Open tonyalaribe opened 2 years ago

tonyalaribe commented 2 years ago

Is there any examples on how to work with or create migrations in selda?

The migration section of the selda documentation is TBA, so I have no idea how to do this. I'm relatively new to Haskell, so some code examples could be really helpful.

tonyalaribe commented 2 years ago

One more question, sometimes it's helpful to fallback to writing raw SQL. Especially on complex larger queries. How can I execute such raw SQL strings with selda? Is there an escape hatch for this?

peacememories commented 2 years ago

This would interest me also. I see that there is utilities for migrating one table to another, this, for one, only covers single table conversions, but more pressingly would require me to keep every version of my data model somewhere in my codebase.

The most preferable way for me would be:

Most migration systems I know store their current migration state in a separate table in the database.