mozIStorageConnection Interface Reference

import "mozIStorageConnection.idl";

List of all members.

Public Member Functions

mozIStorageStatement createStatement (in AUTF8String aSQLStatement)
void executeSimpleSQL (in AUTF8String aSQLStatement)
boolean tableExists (in AUTF8String aTableName)
void beginTransaction ()
void commitTransaction ()
void rollbackTransaction ()
void createTable (in string aTableName, in string aTableSchema)
void createFunction (in string aFunctionName, in long aNumArguments, in mozIStorageFunction aFunction)
void createTrigger (in string aTriggerName, in long aTriggerType, in string aTableName, in string aTriggerFunction, in string aParameters)
void removeTrigger (in string aTriggerName)

Public Attributes

readonly attribute boolean connectionReady
readonly attribute AUTF8String databaseName
readonly attribute long long lastInsertRowID
readonly attribute long lastError
readonly attribute AUTF8String lastErrorString
readonly attribute boolean transactionInProgress
const long TRIGGER_EVENT_DELETE = 1
const long TRIGGER_EVENT_INSERT = 2
const long TRIGGER_EVENT_UPDATE = 3


Member Function Documentation

void mozIStorageConnection::beginTransaction  ) 
 

Begin a new transaction. If a transaction is active,

Exceptions:
NS_ERROR_STORAGE_INVALID_OPERATION. 

void mozIStorageConnection::commitTransaction  ) 
 

Commits the current transaction. If no transaction is active,

Exceptions:
NS_ERROR_STORAGE_NO_TRANSACTION. 

void mozIStorageConnection::createFunction in string  aFunctionName,
in long  aNumArguments,
in mozIStorageFunction  aFunction
 

Create a new SQLite function

mozIStorageStatement mozIStorageConnection::createStatement in AUTF8String  aSQLStatement  ) 
 

Create a mozIStorageStatement for the given SQL expression. The expression may use ?0 ?1 etc. to indicate numbered arguments.

Parameters:
aSQLStatement The SQL statement to execute
Returns:
a new mozIStorageStatement

void mozIStorageConnection::createTable in string  aTableName,
in string  aTableSchema
 

Create the table with the given name and schema. If the table already exists with the given schema, the non-error NS_STORAGE_TABLE_EXISTS is returned. If the table exists but with a different schema, NS_ERROR_STORAGE_TABLE_CONFLICT (?) is thrown.

Parameters:
aID the owner of this table -- XXXtodo
aTableName the table name to be created, consisting of [A-Za-z0-9_], and beginning with a letter.
aTableSchema the schema of the table; what would normally go between the parens in a CREATE TABLE statement: "foo INTEGER, bar STRING".

void mozIStorageConnection::createTrigger in string  aTriggerName,
in long  aTriggerType,
in string  aTableName,
in string  aTriggerFunction,
in string  aParameters
 

void mozIStorageConnection::executeSimpleSQL in AUTF8String  aSQLStatement  ) 
 

Execute a SQL expression, expecting no arguments.

Parameters:
aSQLStatement The SQL statement to execute

void mozIStorageConnection::removeTrigger in string  aTriggerName  ) 
 

void mozIStorageConnection::rollbackTransaction  ) 
 

Rolls back the current transaction. If no transaction is active,

Exceptions:
NS_ERROR_STORAGE_NO_TRANSACTION. 

boolean mozIStorageConnection::tableExists in AUTF8String  aTableName  ) 
 

Check if the given table exists.

Parameters:
aTableName The table to check
Returns:
TRUE if table exists, FALSE otherwise.


Member Data Documentation

readonly attribute boolean mozIStorageConnection::connectionReady
 

whether the database is open or not

readonly attribute AUTF8String mozIStorageConnection::databaseName
 

the current database filename

readonly attribute long mozIStorageConnection::lastError
 

lastError returns the last error code

readonly attribute AUTF8String mozIStorageConnection::lastErrorString
 

lastErrorString returns the last error as a string

readonly attribute long long mozIStorageConnection::lastInsertRowID
 

lastInsertRowID returns the row ID from the last INSERT operation.

readonly attribute boolean mozIStorageConnection::transactionInProgress
 

Returns true if a transaction is active on this connection.

const long mozIStorageConnection::TRIGGER_EVENT_DELETE = 1
 

Create a new trigger. Note that we only support AFTER triggers here, not BEFORE (so that we can support IPC notification of triggers). All triggers created this way are TEMPORARY triggers, i.e. they are only valid for the duration of this connection. Without this, triggers would persist between connections, even if the functions they refer to may no longer be defined; this would be bad.

aParameters is a comma-separated list of parameters, referencing either "new.*" or "old.*", as appropriate for the trigger event type.

const long mozIStorageConnection::TRIGGER_EVENT_INSERT = 2
 

const long mozIStorageConnection::TRIGGER_EVENT_UPDATE = 3
 


The documentation for this interface was generated from the following file:
Generated on Sun Jan 29 09:41:52 2006 by  doxygen 1.4.5