Skip to content
Browse files

improve parameter descriptions in README

  • Loading branch information...
1 parent f55703a commit fcd72e50befd0c87c8e812b6b1abe8fc4040fb6d @wg committed
Showing with 12 additions and 7 deletions.
  1. +12 −7 README
View
19 README
@@ -2,14 +2,19 @@ Erlang PostgreSQL Database Client
* Connect
- {ok, C} = pgsql:connect(Host, [Username, Password, Opts]).
+ {ok, C} = pgsql:connect(Host, [Username], [Password], [Opts]).
- Opts is a property list. The following properties are supported:
+ Host - host to connect to.
+ Username - username to connect as, defaults to $USER.
+ Password - optional password to authenticate with.
+ Opts - property list of extra options. Supported properties:
- - database
- - port
- - ssl (true | false | required)
+ + database
+ + port
+ + ssl (true | false | required)
+ + ssl_opts (see ssl docs in OTP)
+ {ok, C} = pgsql:connect("localhost", "username", [{database, "test_db"}]).
ok = pgsql:close(C).
* Simple Query
@@ -31,7 +36,7 @@ Erlang PostgreSQL Database Client
{error, #error{}} = pgsql:equery(C, "invalid SQL", [Parameters]).
- Parameters - list of values to be bound to $1, $2, $3, etc.
+ Parameters - optional list of values to be bound to $1, $2, $3, etc.
The extended query protocol combines parse, bind, and execute using
the unnamed prepared statement and portal. A "select" statement returns
@@ -55,7 +60,7 @@ Erlang PostgreSQL Database Client
ok = pgsql:bind(C, Statement, [PortalName], ParameterValues).
- PortalName- optional name for the result portal.
+ PortalName - optional name for the result portal.
{ok | partial, Rows} = pgsql:execute(C, Statement, [PortalName], [MaxRows]).
{ok, Count} = pgsql:execute(C, Statement, [PortalName]).

0 comments on commit fcd72e5

Please sign in to comment.
Something went wrong with that request. Please try again.