{"repo":"lpil/pog","free":true,"listed":false,"github":"https://github.com/lpil/pog","clone":"git clone https://github.com/lpil/pog.git","description":"🐘 A PostgreSQL database client for Gleam, based on PGO","language":"Gleam","stars":265,"topics":["gleam","postgresql","postgresql-client","erlang"],"license":"Apache-2.0","category":"databases-storage","readme_excerpt":"Pog A PostgreSQL database client for Gleam, based on [PGO][erlang-pgo]. [erlang-pgo]: https://github.com/erleans/pgo Add a pool to your OTP supervision tree, before any siblings that will need to use the database. Pools are named with a Name from gleam/erlang/process , so create one outside of your supervision tree and pass it down to the creation of the pool. Then in your application you can use a connection created from that name with the pog.named connection to make queries: Support of connection URI Configuring a Postgres connection is done by using Config type in pog . To facilitate connection, and to provide easy integration with the rest of the Postgres ecosystem, pog provides handling of connection URI as defined by Postgres. Shape of connection URI is postgresql://[username:password@][host:port][/dbname][?query] . Call pog.url config with your connection URI, and in case it's correct against the Postgres standard, your Config will be automatically generated! Here's an example, using envoy to read the connection URI from the environment. About JSON In Postgres, you can define a type json or jsonb . Such a type can be query in SQL, but Postgres returns it a simple string, and accepts it as a simple string! When writing or reading a JSON, you can simply use pog.text(json.to string(my json)) and decode.string to respectively write and read them! Timeout By default, every pog query has a 5 seconds timeout, and every query taking more than 5 seconds will automatically be a","default_branch":null,"files":null,"tree":[],"storefront":"/r/lpil","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/lpil/pog/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}