Last active
December 9, 2024 00:31
-
-
Save emag/2438faaee1e72debf77a97dedeab3e9f to your computer and use it in GitHub Desktop.
家計簿アプリケーション
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package kakeibo | |
import cats.effect.Async | |
import cats.effect.kernel.Resource | |
import cats.effect.std.Console | |
import fs2.io.net.Network | |
import natchez.Trace.Implicits.noop | |
import skunk.Session | |
final case class Application[F[_]]( | |
balanceSheet: BalanceSheetApp[F] | |
) | |
object Application { | |
def apply[F[_]: Async: Network: Console](): Resource[F, Application[F]] = | |
for { | |
pool <- Session.pooled[F]( | |
host = "localhost", | |
user = "postgres", | |
password = Some("passwd"), | |
database = "postgres", | |
max = 10 | |
) | |
bsApp <- BalanceSheetApp(pool) | |
} yield new Application(bsApp) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment