Alphabetic list: * DBI.ColumnInfo:: * DBI.Connection:: * DBI.ConnectionInfo:: * DBI.FieldConverter:: * DBI.ResultSet:: * DBI.Row:: * DBI.Statement:: * DBI.Table::

Class tree:
  (DBI.ROE.RASQLRelation) * DBI.Table:: (Object) * DBI.ColumnInfo:: * DBI.Connection:: * DBI.ConnectionInfo:: * DBI.FieldConverter:: * DBI.Row:: * DBI.Statement:: (Iterable) (Stream) * DBI.ResultSet::

DBI.ColumnInfo
==============

Defined in namespace DBI
Superclass: Object
Category: DBI-Framework

DBI.ColumnInfo: accessing
-------------------------

index
     Return the 1-based index of the column in the result set (abstract).

isNullable
     Return whether the column can be NULL (always returns true in ColumnInfo).

name
     Return the name of the column (abstract).

size
     Return the size of the column (abstract).

type
     Return a string containing the type of the column (abstract).

DBI.ColumnInfo: printing
------------------------

displayOn: aStream
     Print a representation of the receiver on aStream.

printOn: aStream
     Print a representation of the receiver on aStream.

DBI.Connection
==============

Defined in namespace DBI
Superclass: Object
Category: DBI-Framework
     I represent a connection to a database.

DBI.Connection class: connecting
--------------------------------

connect: aDSN user: aUserName password: aPassword
     Connect to the database server identified by aDSN using the given username and password.  The DSN is in the format dbi:DriverName:dbname=database_name;host=hostname;port=port Where dbi is constant, DriverName is the name of the driver, and everything else is parameters in the form name1=value1;name2=value2;...

     Individual drivers may parse the parameters differently, though the existing ones all support parameters dbname, host and port.

paramConnect: params user: aUserName password: aPassword
     Connect to the database server using the parameters in params (a Dictionary) and the given username and password (abstract).

DBI.Connection class: initialization
------------------------------------

updateDriverList
     Private - Look for new subclasses of Connection.

DBI.Connection: accessing
-------------------------

>> aString
     Returns a Table object corresponding to the given table.

database
     Returns the database name for this connection.  This corresponds to the catalog in SQL standard parlance (abstract).

fieldConverter
     Returns a FieldConverter that can be used to insert Smalltalk objects into queries.

tableAt: aString
     Returns a Table object corresponding to the given table.

tableAt: aString ifAbsent: aBlock
     Returns a Table object corresponding to the given table.

DBI.Connection: connecting
--------------------------

close
     Close the connection now; should happen on GC too (abstract).

DBI.Connection: querying
------------------------

do: aSQLQuery
     Executes a SQL statement (usually one that doesn't return a result set). Return value is a ResultSet, to which you can send #rowsAffected (abstract).

prepare: aSQLQuery
     Creates a statement object, that can be executed (with parameters, if applicable) repeatedly (abstract).

primTableAt: aString ifAbsent: aBlock
     Returns a Table object corresponding to the given table.  Should be overridden by subclasses.

select: aSQLQuery
     Prepares and executes a SQL statement. Returns the result set or throws an exception on failure (abstract).

DBI.ConnectionInfo
==================

Defined in namespace DBI
Superclass: Object
Category: DBI-Framework
     A utility class to contain connection info.

DBI.ConnectionInfo class: instance creation
-------------------------------------------

fromDSN: aDSN
     Parse a DSN in the format dbi:DriverName:dbname=database_name;host=hostname;port=port where dbi is constant, DriverName is the name of the driver, and everything else is parameters in the form name1=value1;name2=value2;...

DBI.ConnectionInfo: accessing
-----------------------------

driver
     Answer the driver; this is not the driver class.

driver: aString
     Set the driver; this is not the driver class.

paramString: aString
     Set the parameter list.

params
     Return the parsed parameters in a Dictionary.

scheme
     Answer the scheme; the only supported one is 'dbi'.

scheme: aString
     Set the scheme; the only supported one is 'dbi'.

DBI.FieldConverter
==================

Defined in namespace DBI
Superclass: Object
Category: DBI

DBI.FieldConverter class: instance creation
-------------------------------------------

new
     Not commented.

uniqueInstance
     Not commented.

DBI.FieldConverter: actions
---------------------------

print: aValue on: aStream
     Not commented.

printString: aValue
     Not commented.

DBI.FieldConverter: converting-smalltalk
----------------------------------------

writeBoolean: aBoolean on: aStream
     Not commented.

writeDate: aDate on: aStream
     Not commented.

writeDateTime: aDateTime on: aStream
     Not commented.

writeFloat: aFloat on: aStream
     Not commented.

writeInteger: anInteger on: aStream
     Not commented.

writeQuotedDate: aDate on: aStream
     Not commented.

writeQuotedTime: aDate on: aStream
     Not commented.

writeTime: aTime on: aStream
     Not commented.

DBI.ResultSet
=============

Defined in namespace DBI
Superclass: Stream
Category: DBI-Framework
     I represent a result set, ie. the set of rows returned from a SELECT statement. I may also be returned for DML statements (INSERT, UPDATE, DELETE), in which case I only hold the number of rows affected.

DBI.ResultSet: accessing
------------------------

columnAt: aIndex
     Answer the aIndex'th column name.

columnNames
     Answer an array of column names in order (abstract).

columns
     Answer a Dictionary of column name -> ColumnInfo pairs (abstract).

isDML
     Returns true if the statement was not a SELECT or similar operation (e.g. SHOW, DESCRIBE, EXPLAIN).

isSelect
     Returns true if the statement was a SELECT or similar operation (e.g. SHOW, DESCRIBE, EXPLAIN), false otherwise.

rowCount
     Returns the number of rows in the result set; error for DML statements.

rows
     Answer the contents of the execution result as array of Rows.

rowsAffected
     For DML statments, returns the number of rows affected; error for SELECT statements.

statement
     Return the Statement, if any, that generated the result set.

DBI.ResultSet: cursor access
----------------------------

atEnd
     Return whether all the rows in the result set have been consumed. (abstract).

fetch
     Return the next row, or nil if at the end of the result set.

next
     Return the next row, or raise an error if at the end of the stream (abstract).

DBI.ResultSet: printing
-----------------------

printOn: aStream
     Print a representation of the receiver on aStream.

DBI.ResultSet: stream protocol
------------------------------

position
     Returns the current row index (0-based) in the result set (abstract).

position: anInteger
     Sets the current row index (0-based) in the result set (abstract).

size
     Returns the number of rows in the result set.

DBI.Row
=======

Defined in namespace DBI
Superclass: Object
Category: DBI-Framework
     I represent a row in a result set.

DBI.Row: accessing
------------------

asArray
     Return the values of the columns.

asDictionary
     Return the names and values of the columns as a dictionary.

at: aColumnName
     Return the value of the named column (abstract).

atIndex: aColumnIndex
     Return the value of the column at the given 1-based index (abstract).

columnAt: aIndex
     Return a ColumnInfo object for the aIndex-th column in the row.

columnCount
     Return the number of columns in the row.

columnNames
     Return an array of column names for the columns in the row.

columns
     Return a Dictionary of ColumnInfo objects for the columns in the row, where the keys are the column names.

keysAndValuesDo: aBlock
     Pass to aBlock each column name and the corresponding value.

resultSet
     Return the result set that includes the receiver.

DBI.Row: printing
-----------------

printOn: aStream
     Print a representation of the receiver on aStream.

DBI.Statement
=============

Defined in namespace DBI
Superclass: Object
Category: DBI-Framework
     I represent a prepared statement.

DBI.Statement class: instance creation
--------------------------------------

on: aConnection
     Return a new statement for this connection.

DBI.Statement: querying
-----------------------

execute
     Execute with no parameters (abstract).

executeWith: aParameter
     Execute with one parameters.

executeWith: aParam1 with: aParam2
     Execute with two parameters.

executeWith: aParam1 with: aParam2 with: aParam3
     Execute with three parameters.

executeWithAll: aParams
     Execute taking parameters from the Collection aParams (abstract).

DBI.Table
=========

Defined in namespace DBI
Superclass: DBI.ROE.RASQLRelation
Category: DBI

DBI.Table: accessing
--------------------

columnAt: aIndex
     Answer the aIndex'th column name.

columnNames
     Answer an array of column names in order (abstract).

columns
     Not commented.

database
     Returns the database name for this table.  This corresponds to the catalog in SQL standard parlance.

DBI.Table: core
---------------

size
     Not commented.

DBI.Table: printing
-------------------

print: anObject on: aStream
     Not commented.