Module: Informix

Defined in:
lib/informix/interval.rb,
lib/informix.rb,
lib/informix/seqcursor.rb,
lib/informix/exceptions.rb,
lib/informix/scrollcursor.rb,
ext/informixc.c

Overview

– The following code is a translation of the original C code written by Edwin M. Fine <emofine at finecomputerconsultants dot com> ++

Defined Under Namespace

Modules: Cursor, Interval Classes: CursorBase, DataError, Database, DatabaseError, Error, ExcInfo, InsertCursor, IntegrityError, InterfaceError, InternalError, IntervalBase, IntervalDTS, IntervalYTM, NotSupportedError, OperationalError, ProgrammingError, ScrollCursor, SequentialCursor, Slob, Statement, Warning

Constant Summary collapse

VERSION =
"0.7.3"

Class Method Summary collapse

Class Method Details

.connect(dbname, user = nil, password = nil, &block) ⇒ Object

Shortcut to create a Database object connected to dbname as user with password. If these are not given, connects to dbname as the current user.

The Database object is passed to the block if it's given, and automatically closes the connection when the block terminates, returning the value of the block.

Examples:

Connecting to stores with our current credentials:

db = Informix.connect('stores')

Same thing, using a block and using a different server. The connection is closed automatically when the block terminates.

result = Informix.connect('[email protected]_shm') do |db|
  # do something with db
  # the last expression evaluated will be returned
done

57
58
59
# File 'lib/informix.rb', line 57

def self.connect(dbname, user = nil, password = nil, &block)
  Database.open(dbname, user, password, &block)
end

.versionObject

Returns the version of this Ruby/Informix driver. Note that this is NOT the Informix database version.

Informix.version => string

65
66
67
# File 'lib/informix.rb', line 65

def self.version
  VERSION
end