|
Previous Class |
Solar_Sql_Adapter |
Next Page |
Solar_Sql_Adapter
Abstract base class for specific RDBMS adapters.
When writing an adapter, you need to override these abstract methods:
<?php
abstract protected function _fetchTableList();
abstract protected function _fetchTableCols($table);
abstract protected function _createSequence($name, $start = 1);
abstract protected function _dropSequence($name);
abstract protected function _nextSequence($name);
abstract protected function _dropIndex($table, $name);
abstract protected function _modAutoincPrimary(&$coldef, $autoinc, $primary);
?>
If the backend needs identifier deconfliction (e.g., PostgreSQL), you will want to override _modIndexName() and _modSequenceName(). Most times this will not be necessary.
If the backend does not have explicit "LIMIT ... OFFSET" support, you will want to override _modSelect($stmt, $parts) to rewrite the query in order to emulate limit/select behavior. This is particularly necessary for Microsoft SQL and Oracle.
Catalog
This class is part of the Solar_Sql package.
Inheritance:
- Solar_Base
- Solar_Sql_Adapter
Constants
None.
Public Properties
The Solar_Sql_Adapter class has no public properties; try the list of all properties.
Public Methods
These are all the public methods in the Solar_Sql_Adapter class.
You can also view the list of all public, protected, and private methods.
__construct()- Constructor.
__destruct()- Default destructor; does nothing other than provide a safe fallback for calls to parent::__destruct().
addColumn()- Adds a portable column to a table in the database.
apiVersion()- Reports the API version for this class.
begin()- Leave autocommit mode and begin a transaction.
commit()- Commit a transaction and return to autocommit mode.
connect()- Creates a PDO object and connects to the database.
createIndex()- Creates a portable index on a table.
createSequence()- Creates a sequence in the database.
createTable()- Creates a portable table.
delete()- Deletes rows from the table based on a WHERE clause.
disconnect()- Closes the database connection.
dropColumn()- Drops a column from a table in the database.
dropIndex()- Drops an index from a table in the database.
dropSequence()- Drops a sequence from the database.
dropTable()- Drops a table from the database, if it exists.
dump()- Convenience method for getting a dump the whole object, or one of its properties, or an external variable.
fetchAll()- Fetches all rows from the database using sequential keys.
fetchAssoc()- Fetches all rows from the database using associative keys (defined by the first column).
fetchCol()- Fetches the first column of all rows as a sequential array.
fetchOne()- Fetches one row from the database.
fetchPairs()- Fetches an associative array of all rows as key-value pairs (first column is the key, second column is the value).
fetchPdo()- Fetches a PDOStatement result object.
fetchSql()- Builds the SQL statement and returns it as a string instead of executing it.
fetchTableCols()- Returns an array describing table columns from the cache; if the cache entry is not available, queries the database for the column descriptions.
fetchTableList()- Returns a list of database tables from the cache; if the cache entry is not available, queries the database for the list of tables.
fetchValue()- Fetches the very first value (i.e., first column of the first row).
getPdo()- Get the PDO connection object (connects to the database if needed).
getProfile()- Get the query profile array.
insert()- Inserts a row of data into a table.
lastInsertId()- Get the last auto-incremented insert ID from the database.
locale()- Looks up class-specific locale strings based on a key.
nextSequence()- Gets the next number in a sequence; creates the sequence if it does not exist.
query()- Prepares and executes an SQL statement, optionally binding values to named parameters in the statement.
quote()- Safely quotes a value for an SQL statement.
quoteInto()- Quotes a value and places into a piece of text at a placeholder.
quoteMulti()- Quote multiple text-and-value pieces.
rollback()- Roll back a transaction and return to autocommit mode.
setProfiling()- Turns profiling on and off.
update()- Updates a table with specified data based on a WHERE clause.
Local
- Overview
- Constants
- Properties
- Methods
- __construct()
- __destruct()
- _checkIdentifier()
- _createSequence()
- _dropIndex()
- _dropSequence()
- _dsn()
- _exception()
- _fetchTableCols()
- _fetchTableList()
- _getCacheKey()
- _getTypeSizeScope()
- _modAutoincPrimary()
- _modIndexName()
- _modSelect()
- _modSequenceName()
- _nextSequence()
- _postConnect()
- _select()
- _sqlColdef()
- _sqlCreateTable()
- _sqlSelect()
- addColumn()
- apiVersion()
- begin()
- commit()
- connect()
- createIndex()
- createSequence()
- createTable()
- delete()
- disconnect()
- dropColumn()
- dropIndex()
- dropSequence()
- dropTable()
- dump()
- fetchAll()
- fetchAssoc()
- fetchCol()
- fetchOne()
- fetchPairs()
- fetchPdo()
- fetchSql()
- fetchTableCols()
- fetchTableList()
- fetchValue()
- getPdo()
- getProfile()
- insert()
- lastInsertId()
- locale()
- nextSequence()
- query()
- quote()
- quoteInto()
- quoteMulti()
- rollback()
- setProfiling()
- update()