Commits

Will Glozer  committed 6b24797

improve parameter descriptions in README

  • Participants
  • Parent commits afa6530

Comments (0)

Files changed (1)

 
 * 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
 
   {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
 
   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]).