Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kopera/erlang-pgc
Erlang PostgreSQL client
https://github.com/kopera/erlang-pgc
database erlang postgresql sql
Last synced: about 2 months ago
JSON representation
Erlang PostgreSQL client
- Host: GitHub
- URL: https://github.com/kopera/erlang-pgc
- Owner: kopera
- License: apache-2.0
- Created: 2017-08-10T13:26:50.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-08-20T16:27:43.000Z (5 months ago)
- Last Synced: 2024-08-20T18:52:50.530Z (5 months ago)
- Topics: database, erlang, postgresql, sql
- Language: Erlang
- Homepage:
- Size: 275 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# erlang-pgc
PostgreSQL client for Erlang.
## Examples
```erl
1> {ok, Client} = pgc:start_link(#{address => {tcp, "localhost", 5432}}, #{
user => "postgres",
password => "postgres",
database => "postgres"
}, #{limit => 1}).
{ok, <0.234.0>}
2> pgc:execute(Client, {"select 'hello ' || $1 as message", ["world"]}).
{ok, #{command => select, columns => [message], rows => 1, notices => []}, [
#{message => <<"hello world">>}
]}
3> pgc:execute(Client, {"select row('hello', $1::text) as record", ["world"]}).
{ok,#{command => select, columns => [record], rows => 1, notices => []}, [
#{record => #{1 => <<"hello">>, 2 => <<"world">>}}
]}
```## Setup
You need to add `pgc` as a dependency to your project. If you are using `rebar3`, you can add the following to your `rebar.config`:
```erlang
{deps, [
{pgc, {git, "git://github.com/kopera/erlang-pgc.git", {branch, "main"}}}
]}.
```Also ensure that `pgc` is added as a dependency to your application, by
updating your `.app.src` file:```erlang
{application, my_app, [{applications, [
kernel,
stdlib,pgc % <- You need this in your applications list
]}
]}.
```## Usage
TODO
## Features
TODO
## Data representation
TODO