Arena  1.0
A content management system
 All Classes Files Functions Variables Pages
Library.DataSource.Databases.ADatabase Class Reference

The abstract interface to a database. More...

+ Inheritance diagram for Library.DataSource.Databases.ADatabase:

Public Member Functions

def init
 Initializer.
 
def connect
 Connect to the database. More...
 
def open
 Open the specified database. More...
 
def lastMessage
 Return the last message generated by the database. More...
 
- Public Member Functions inherited from Library.DataSource.DataSources.ADataSource
def __init__
 Construct a new data source. More...
 
def init
 Initializer.
 
def connect
 Connect to the data source. More...
 
def disconnect
 Disconnect from the data source. More...
 
def count
 Count the number of records that would be returned by the specified fetch operation. More...
 
def fetch
 Fetch data from the data source. More...
 
def insert
 Insert data into the data source. More...
 
def update
 Update data in the data source. More...
 
def delete
 Delete data from the data source. More...
 
def categories
 Retrieve a list of all categories (or tables) in the data source. More...
 
- Public Member Functions inherited from Library.Base.Events.ALoggingEventfulObject
def __init__
 Constructor. More...
 
def init
 Initializer.
 
def error
 Generate an error event. More...
 
def log
 Log the specified item. More...
 
def Log
 Retrieve the log used by the class.
 
- Public Member Functions inherited from Library.Base.Events.AnEventfulObject
def __init__
 Constructor. More...
 
def init
 Initializer.
 
def __del__
 Destructor.
 
def parseParams
 Parse the specified parameters, looking for named events and setting event handlers as appropriate. More...
 
def generate
 Generate the named event.
 
def update
 Update the events generated by the object.
 
def error
 Generate an error event. More...
 
def toString
 Construct a string representation of the object. More...
 
def on
 Set the handler for the specified event. More...
 
def onMultiple
 Set handlers for multiple events. More...
 
def handlerFor
 Retrieve the handler for the specified event. More...
 
def generates
 Determine whether or not the object generates the named event. More...
 
def __getitem__
 Retrieve the value of the named property.
 
def __setitem__
 Set the value of the named property.
 
- Public Member Functions inherited from Library.Base.Classwork.AnObject
def init
 Initialize a new object instance. More...
 
def __init__
 Construct and initialize a new instance of AnObject. More...
 
def __del__
 Destroy the object instance. More...
 
def displayName
 Construct a "pretty" display name for the class instance, based on the name of its class. More...
 
def implements
 Determine whether the class instance is related to the specified class. More...
 
def toString
 Return a string representation of the class, suitable for output to a console or text-based device. More...
 
def __str__
 Return a string representation of the class. More...
 
def classname
 Return the name of the class from which the instance was created. More...
 
def name
 Return the name of the class. More...
 
- Public Member Functions inherited from Library.String.Utilities.IsPrintable
def toString
 Return a string representation of the class conveniently. More...
 
def __str__
 Return a string representation of the class. More...
 
def printTo
 Print a string representation of the class to the specified stream. More...
 

Detailed Description

The abstract interface to a database.

Member Function Documentation

def Library.DataSource.Databases.ADatabase.connect (   Self,
  params 
)

Connect to the database.

This routine should be implemented by descendant classes. A status code should be returned to indicate success or failure. Zero (0) is assumed to mean that a connection was successfully made.

This routine expects that params will contain the following items:

  • password – The password to use, if any, when connecting to the database. This parameter may be omitted if the database in question does not require a password for connections, as is the case with sqlite databases. This parameter is kept separate from those passed to the constructor in order to prevent it from being printed when a string representation of ADatabase is created by calling ADatabase.toString().
def Library.DataSource.Databases.ADatabase.lastMessage (   Self)

Return the last message generated by the database.

Not all databases may support this method; if they do, however, this method will return the last status or error message generated by the data source; otherwise, this routine should return None.

def Library.DataSource.Databases.ADatabase.open (   Self,
  databaseName,
  params 
)

Open the specified database.

This method should be implemented by descendant classes. It can be used when connected to a database provider to specify which database to use. For certain database providers, such as sqlite, this method may do nothing at all.


The documentation for this class was generated from the following file: