File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,15 +35,14 @@ pub fn start_application_supervisor(pool_name: process.Name(pog.Message)) {
3535}
3636```
3737
38- Then in your application you can use a subject created from that name to make
39- queries:
38+ Then in your application you can use a connection created from that name with
39+ the ` pog.named_connection ` to make queries:
4040
4141``` gleam
4242import pog
4343import gleam/dynamic/decode
44- import gleam/erlang/process.{type Subject}
4544
46- pub fn run(db: Subject( pog.Message) ) {
45+ pub fn run(db: pog.Connection ) {
4746 // An SQL statement to run. It takes one int as a parameter
4847 let sql_query = "
4948 select
@@ -94,9 +93,8 @@ import envoy
9493import gleam/erlang/process.{type Name}
9594import pog
9695
97- /// Read the DATABASE_URL environment variable.
98- /// Generate the pog.Config from that database URL.
99- /// Finally, connect to database.
96+ /// Read the DATABASE_URL environment variable and then
97+ /// build the pog.Config from that database URL.
10098pub fn read_connection_uri(name: Name(pog.Message)) -> Result(pog.Config, Nil) {
10199 use database_url <- result.try(envoy.get("DATABASE_URL"))
102100 pog.url_config(name, database_url)
You can’t perform that action at this time.
0 commit comments