Connect to local/fly database, insert new weather data

This commit is contained in:
Guntis Smaukstelis
2023-12-10 18:47:56 +02:00
parent 526426139c
commit f956d658d5
3 changed files with 54 additions and 17 deletions
+7 -6
View File
@@ -8,15 +8,16 @@ import server.Server
object Main extends IOApp {
def run(args: List[String]): IO[ExitCode] = {
println(System.getenv("DATABASE_URL"))
// postgres://weather_tool:XID547uldXliJBa@weather-tool-db.flycast:5432/weather_tool?sslmode=disable
// println(System.getenv("DATABASE_URL"))
for {
// transactor <- DBConnection.transactor[IO]
// postgresService <- PostgresService.of(transactor)
// _ <- postgresService.createWeatherTable // create table if it does not exists
transactor <- DBConnection.transactor[IO]
postgresService <- PostgresService.of(transactor)
_ <- postgresService.createWeatherTable // create table if it does not exists
fileService <- FileService.of
// dataService <- DataService.of(fileService, postgresService)
dataService <- DataService.of(fileService)
dataService <- DataService.of(fileService, postgresService)
// dataService <- DataService.of(fileService)
fetch <- FetchService.of
fileFetchScheduler <- FileFetchScheduler.of(dataService, fetch)