{"repo":"agu-z/roc-pg","free":true,"listed":false,"github":"https://github.com/agu-z/roc-pg","clone":"git clone https://github.com/agu-z/roc-pg.git","description":"🐘 Use PostgreSQL databases from Roc","language":"Roc","stars":56,"topics":["database","postgresql","query-builder","roc-lang"],"license":"UPL-1.0","category":"databases-storage","readme_excerpt":"roc-pg Interface with PostgreSQL databases from Roc. This package implements a PostgreSQL client on pure Roc that depends only on a TCP effect from the platform. It exposes a simple API that allows you to run SQL commands as strings and a query builder that helps you write composable type-safe queries against your schema. Status I'd like this to become a stable PostgreSQL interface for Roc, but this project is currently a work in progress. You can already use this to build useful applications. However, until we have a platform with TLS support, you should stick to experiments or simple apps where you run the database in the same machine. Query Builder For a while, I explored creating a type-safe query builder on top of roc-pg. I gave some cool demos, and the core idea seemed promising. Unfortunately, I didn't get to build enough of it to be helpful in a real application, and nowadays, I don't have the time it'd require to make it so. You can see an example of what that looked like here. Examples Connecting and performing a query Parameterized queries Prepared statements Batch commands in a single roundtrip (applicative) Note: select user referes to prepared statement in the previous example Batch commands in a single roundtrip (list) Note: roc-pg automatically reuses statements in a batch by only parsing (and describing) once per unique SQL string. This also works with applicative batches. Documentation The API has been in a state of flux until recently. I have now started wo","default_branch":null,"files":null,"tree":[],"storefront":"/r/agu-z","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/agu-z/roc-pg/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."}