Commits

Michael Granger committed 4514df7

Update PG::Connection documentation

Comments (0)

Files changed (2)

ext/pg_connection.c

 #include "pg.h"
 
 
-/********************************************************************
- *
- * Document-class: PG::Connection
- *
- * The class to access PostgreSQL RDBMS, based on the libpq interface,
- * provides convenient OO methods to interact with PostgreSQL.
- *
- * For example, to send query to the database on the localhost:
- *    require 'pg'
- *    conn = PG::Connection.open(:dbname => 'test')
- *    res = conn.exec('SELECT $1 AS a, $2 AS b, $3 AS c',[1, 2, nil])
- *    # Equivalent to:
- *    #  res  = conn.exec('SELECT 1 AS a, 2 AS b, NULL AS c')
- *
- * See the PG::Result class for information on working with the results of a query.
- *
- */
 VALUE rb_cPGconn;
 
 static PQnoticeReceiver default_notice_receiver = NULL;

lib/pg/connection.rb

 
 require 'pg' unless defined?( PG )
 
-# The PG connection class.
+# The PostgreSQL connection class. The interface for this class is based on
+# {libpq}[http://www.postgresql.org/docs/9.2/interactive/libpq.html], the C
+# application programmer's interface to PostgreSQL. Some familiarity with libpq
+# is recommended, but not necessary.
+#
+# For example, to send query to the database on the localhost:
+#
+#    require 'pg'
+#    conn = PG::Connection.open(:dbname => 'test')
+#    res = conn.exec_params('SELECT $1 AS a, $2 AS b, $3 AS c', [1, 2, nil])
+#    # Equivalent to:
+#    #  res  = conn.exec('SELECT 1 AS a, 2 AS b, NULL AS c')
+#
+# See the PG::Result class for information on working with the results of a query.
+#
 class PG::Connection
 
 	# The order the options are passed to the ::connect method.