Sha256: e782e4c316c9a98e73b4d47dcc40d8bb2e4416c24a972ee19350845fb5be0b94
Contents?: true
Size: 444 Bytes
Versions: 123
Compression:
Stored size: 444 Bytes
Contents
# -*- ruby -*- # vim: set nosta noet ts=4 sw=4: # encoding: utf-8 require 'pg' # This is a minimal example of a function that can test an existing PG::Connection and # reset it if necessary. def check_connection( conn ) begin conn.exec( "SELECT 1" ) rescue PG::Error => err $stderr.puts "%p while testing connection: %s" % [ err.class, err.message ] conn.reset end end conn = PG.connect( dbname: 'test' ) check_connection( conn )
Version data entries
123 entries across 123 versions & 4 rubygems