Postgres supports the h_store type, to manage a hash map directly in PG columns.
While it's probably easier to use jsonb nowadays, it could be useful to add support for older DB.
After diving in pg_types, used internally by pgo, I figured out that pushing a native gleam Dict is enough. Right now, using the ugly dynamic trick (from |> unsafe_coerce) is working, but we could think to add a function like hstore: fn (Dict(String, a)) -> Value in the future.
I'm not sure we should add such a function to the package, but I think it's useful enough to keep this info somewhere, at least to let people interested to know there's a solution to their problem, and wait before someone really needs it before implementing a solution? To make sure we have a correct API.
Postgres supports the
h_storetype, to manage a hash map directly in PG columns.While it's probably easier to use
jsonbnowadays, it could be useful to add support for older DB.After diving in
pg_types, used internally bypgo, I figured out that pushing a native gleamDictis enough. Right now, using the ugly dynamic trick (from |> unsafe_coerce) is working, but we could think to add a function likehstore: fn (Dict(String, a)) -> Valuein the future.I'm not sure we should add such a function to the package, but I think it's useful enough to keep this info somewhere, at least to let people interested to know there's a solution to their problem, and wait before someone really needs it before implementing a solution? To make sure we have a correct API.