Database
Explore how to create pure functional database migrations in Scala by encapsulating side effects with IO monads and applying the interpreter pattern. Understand how to handle exceptions safely using MonadError, improving your HTTP API robustness.
We'll cover the following...
We'll cover the following...
Migrations
For the sake of simplicity, we will stick to Flyway for our database migrations. The only difference will be in how we wrap the migration code. We will Encapsulate the code properly within an IO to defer side effects.
While we’re at it, we may just as well write our migration code ...