Group Group Group Group Group Group Group Group Group

Trying to use pool in Kitura server app

In application the app class you are calling Persistence.setUp(). But you are not passing “pool” var out of it. So in my application when I want to use SwiftKuery raw sql and access the pool for a connection there does not seem to be a way of accessing pool. You are creating pool inside a static function and assigning it to Database.default. Have no idea how to access it.
Thanks,
Garth

Solved my issue. First I added extension App to my Routes swift. Then found answer on page 195 of Kitura book. "let pool = PostgreSQLConnection.createPool(
host: ProcessInfo.processInfo.environment[“DBHOST”]
?? "localhost”

Excerpt From: David Okun. “Server Side Swift with Kitura.” Apple Books.
This grabbed the correct dbhost for inside docker image…
Garth