Back to index
|mozIStorageStatement||createStatement (in AUTF8String aSQLStatement)|
|Create a mozIStorageStatement for the given SQL expression. |
|void||executeSimpleSQL (in AUTF8String aSQLStatement)|
|Execute a SQL expression, expecting no arguments. |
|boolean||tableExists (in AUTF8String aTableName)|
|Check if the given table exists. |
|boolean||indexExists (in AUTF8String aIndexName)|
|Check if the given index exists. |
|Begin a new transaction. |
|void||beginTransactionAs (in PRInt32 transactionType)|
|Commits the current transaction. |
|Rolls back the current transaction. |
|void||createTable (in string aTableName, in string aTableSchema)|
|Create the table with the given name and schema. |
|void||createFunction (in string aFunctionName, in long aNumArguments, in mozIStorageFunction aFunction)|
|Create a new SQLite function. |
|This is used to preload the database cache. |
|readonly attribute boolean||connectionReady|
|whether the database is open or not |
|readonly attribute nsIFile||databaseFile|
|The current database nsIFile. |
|readonly attribute long long||lastInsertRowID|
|lastInsertRowID returns the row ID from the last INSERT operation. |
|readonly attribute long||lastError|
|The last error SQLite error code. |
|readonly attribute AUTF8String||lastErrorString|
|The last SQLite error as a string (in english, straight from the sqlite library). |
|readonly attribute boolean||transactionInProgress|
|Returns true if a transaction is active on this connection. |
|const PRInt32||TRANSACTION_DEFERRED = 0|
|Begins a new transaction with the given type. |
|const PRInt32||TRANSACTION_IMMEDIATE = 1|
|const PRInt32||TRANSACTION_EXCLUSIVE = 2|
mozIStorageConnection represents a database connection attached to a specific file or to the in-memory data storage.
It is the primary interface for interacting with a database, including creating prepared statements, executing SQL, and examining database errors.
Begin a new transaction.
sqlite default transactions are deferred. If a transaction is active, throws an error.
Commits the current transaction.
If no transaction is active,
|void mozIStorageConnection::createFunction||(||in string||aFunctionName,|
Create a new SQLite function.
Create the table with the given name and schema.
If the table already exists, NS_ERROR_FAILURE is thrown. (XXX at some point in the future it will check if the schema is the same as what is specified, but that doesn't happen currently.)
|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: e.g., "foo INTEGER, bar STRING".|
|NS_ERROR_FAILURE||if the table already exists or could not be created for any other reason.|
Execute a SQL expression, expecting no arguments.
|aSQLStatement||The SQL statement to execute|
Check if the given index exists.
|aIndexName||The index to check|
This is used to preload the database cache.
It loads pages from the start of the database file until the memory cache (specified by "PRAGMA cache_size=") is full or the entire file is read.
The cache MUST be active on the database for this to work. This means that you must have a transaction open on the connection, or have a transaction open on another connection that shares the same pager cache. This cached data will go away when the transaction is closed.
This preload operation can dramatically speed up read operations because the data is loaded as one large block. Normally, pages are read in on demand, which can cause many disk seeks.
Rolls back the current transaction.
If no transaction is active,
Check if the given table exists.
|aTableName||The table to check|