Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lhns/doobie-flyway
Flyway migrations for doobie
https://github.com/lhns/doobie-flyway
db doobie flyway migrations scala
Last synced: 17 days ago
JSON representation
Flyway migrations for doobie
- Host: GitHub
- URL: https://github.com/lhns/doobie-flyway
- Owner: lhns
- License: apache-2.0
- Created: 2022-07-04T08:20:53.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-09T00:22:38.000Z (about 1 month ago)
- Last Synced: 2024-10-11T00:09:26.506Z (about 1 month ago)
- Topics: db, doobie, flyway, migrations, scala
- Language: Scala
- Homepage:
- Size: 141 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# doobie-flyway
[![build](https://github.com/lhns/doobie-flyway/actions/workflows/build.yml/badge.svg)](https://github.com/lhns/doobie-flyway/actions/workflows/build.yml)
[![Release Notes](https://img.shields.io/github/release/lhns/doobie-flyway.svg?maxAge=3600)](https://github.com/lhns/doobie-flyway/releases/latest)
[![Maven Central](https://img.shields.io/maven-central/v/de.lhns/doobie-flyway_2.13)](https://search.maven.org/artifact/de.lhns/doobie-flyway_2.13)
[![Apache License 2.0](https://img.shields.io/github/license/lhns/doobie-flyway.svg?maxAge=3600)](https://www.apache.org/licenses/LICENSE-2.0)
[![Scala Steward badge](https://img.shields.io/badge/Scala_Steward-helping-blue.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAMAAAARSr4IAAAAVFBMVEUAAACHjojlOy5NWlrKzcYRKjGFjIbp293YycuLa3pYY2LSqql4f3pCUFTgSjNodYRmcXUsPD/NTTbjRS+2jomhgnzNc223cGvZS0HaSD0XLjbaSjElhIr+AAAAAXRSTlMAQObYZgAAAHlJREFUCNdNyosOwyAIhWHAQS1Vt7a77/3fcxxdmv0xwmckutAR1nkm4ggbyEcg/wWmlGLDAA3oL50xi6fk5ffZ3E2E3QfZDCcCN2YtbEWZt+Drc6u6rlqv7Uk0LdKqqr5rk2UCRXOk0vmQKGfc94nOJyQjouF9H/wCc9gECEYfONoAAAAASUVORK5CYII=)](https://scala-steward.org)[Flyway](https://flywaydb.org/) migrations for [doobie](https://github.com/tpolecat/doobie).
### build.sbt
```sbt
libraryDependencies += "de.lhns" %% "doobie-flyway" % "0.4.0"
```## Usage
```scala
def transactor(config: DbConfig): Resource[IO, Transactor[IO]] =
for {
ce <- ExecutionContexts.fixedThreadPool[IO](config.poolSizeOrDefault)
xa <- HikariTransactor
.newHikariTransactor[IO](
config.driverOrDefault,
config.url,
config.user,
config.password,
ce
)
_ <- Flyway(xa) { flyway =>
for {
info <- flyway.info()
_ <- flyway
.configure(_
.withBaselineMigrate(info)
.validateMigrationNaming(true)
)
.migrate()
} yield ()
}
} yield xa
```## License
This project uses the Apache 2.0 License. See the file called LICENSE.