Browse Source

improve description of squery in README

Will 16 years ago
parent
commit
4acc379c6b
1 changed files with 6 additions and 2 deletions
  1. 6 2
      README

+ 6 - 2
README

@@ -23,11 +23,15 @@ Erlang PostgreSQL Database Client
 
 
 * Simple Query
 * Simple Query
 
 
-  {ok, Columns, Rows} = pgsql:squery(C, Sql).
-  {error, Error}      = pgsql:squery(C, InvalidSql).
+  {ok, Columns, Rows}        = pgsql:squery(C, "select ...").
+  {ok, Count}                = pgsql:squery(C, "update ...").
+  {ok, Count, Columns, Rows} = pgsql:squery(C, "insert ... returning ...").
+
+  {error, Error}             = pgsql:squery(C, "invalid SQL").
 
 
   Columns       - list of column records, see pgsql.hrl for definition.
   Columns       - list of column records, see pgsql.hrl for definition.
   Rows          - list of tuples, one for each row.
   Rows          - list of tuples, one for each row.
+  Count         - integer count of rows inserted/updated/etc
 
 
   The simple query protocol returns all columns as text (Erlang binaries)
   The simple query protocol returns all columns as text (Erlang binaries)
   and does not support binding parameters.
   and does not support binding parameters.