DBI for Erlang (PostgreSQL)
===========================
[](https://travis-ci.org/dbi-beam/dbi_pgsql)
[](https://codecov.io/gh/dbi-beam/dbi_pgsql)
[](https://raw.githubusercontent.com/dbi-beam/dbi_pgsql/master/COPYING)
[](https://hex.pm/packages/dbi_pgsql)
Database Interface for Erlang and Elixir using PostgreSQL. For further information check [DBI](https://github.com/dbi-beam/dbi).
### Install (rebar3)
To use it, with rebar, you only need to add the dependency to the rebar.config file:
```erlang
{deps, [
{dbi_pgsql, "0.1.1"}
]}
```
### Install (mix)
To use it, with mix, you only need to add the dependency to the mix.exs file:
```elixir
{:dbi_pgsql, "~> 0.1.1"}
```
### Configuration
The configuration is made in the configuration file (`sys.config` or `app.config`) so, you can add a new block for config the database connection as follow:
```erlang
{dbi, [
{mystrongdb, [
{type, pgsql},
{host, "localhost"},
{user, "root"},
{pass, "root"},
{database, "mystrongdb"},
{poolsize, 100}
]}
]}
```
In case you're using Elixir, you can define the configuration for your project in this way:
```elixir
confg :dbi, mystrongdb: [
type: :pgsql,
host: 'localhost',
user: 'root',
pass: 'root',
database: 'mystrongdb',
poolsize: 100
]
```
Enjoy!