When I run the query in the program attached below I get an exception that seems to originate from Erlang.
gleam run
Compiling psqltest
Compiled in 0.18s
Running psqltest.main
exception error: no function clause matching
gleam_pgo_ffi:convert_error(badarg) (/Users/jaras/code/psqltest/build/dev/erlang/gleam_pgo/_gleam_artefacts/gleam_pgo_ffi.erl, line 71)
in function gleam_pgo_ffi:query/3 (/Users/jaras/code/psqltest/build/dev/erlang/gleam_pgo/_gleam_artefacts/gleam_pgo_ffi.erl, line 68)
in call from gleam@pgo:execute/4 (/Users/jaras/code/psqltest/build/dev/erlang/gleam_pgo/_gleam_artefacts/gleam@pgo.erl, line 193)
in call from psqltest:main/0 (/Users/jaras/code/psqltest/build/dev/erlang/psqltest/_gleam_artefacts/psqltest.erl, line 25)
the issue I found was that token and expires was swapped in the sql statement, when those were swapped back it worked as expected.
-- auto-generated definition
CREATE TABLE sessions
(
id bigserial
PRIMARY KEY,
token bytea NOT NULL
UNIQUE,
user_id integer NOT NULL,
expires timestamp WITH TIME ZONE DEFAULT NOW() NOT NULL
);
ALTER TABLE sessions
OWNER TO dkjanras;
CREATE INDEX sessions_token_index
ON sessions (token);
When I run the query in the program attached below I get an exception that seems to originate from Erlang.
the issue I found was that token and expires was swapped in the sql statement, when those were swapped back it worked as expected.