Hi
I’m starting to learn erlang and right now I’m trying to connect to postgresql but I keep getting errors that are not clear at all.
I used pgo and this is what I tried:
pgo_pool:start_link(pgo_pool, #{user => "dev", password => "password", database => "dev"}).
But I get a huge crash report when I run it in rebar3 shell that starts with this:
=ERROR REPORT==== 21-Aug-2022::08:53:08.607321 ===
** State machine <0.210.0> terminating
** Last event = {internal,load}
** When server state = {ready,{data,pgo_pool,
#{database => “dev”,
password => “password”,user => “dev”},
undefined}}
** Reason for termination = error:{badmatch,undefined}
** Callback modules = [pgo_type_server]
** Callback mode = state_functions
which does not seem to have any indication of what I did wrong!
Then I tried:
pgo:start_pool(pgo_pool, #{user => "dev", password => "password", database => "dev"}).
This time I got:>
** exception exit: {noproc,{gen_server,call,
[pgo_sup,
{start_child,[pgo_pool,
#{database => “dev”,password => “password”,user => “dev”}]},
infinity]}}
in function gen_server:call/3 (gen_server.erl, line 247)
again, no idea what it means!
Any idea what’s going on here?
Thanks