Last active
April 9, 2020 17:25
-
-
Save samuelorji/5230baa2ea11bdb2d9eaad941694e898 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
sealed trait DatabaseDriver { | |
// //A lot of database config we don't care about | |
// //Database object | |
lazy val db = new ConnectionPool(_, _) | |
} | |
trait PostgresDatabase extends Database with DatabaseDriver { | |
private def runQuery(query: String): IO[Throwable, QueryResult] = { | |
for { | |
result <- ZIO.fromFuture(_ => db.sendPreparedStatement(query)) | |
} yield result | |
} | |
//Other Stuff :) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment