abstract class DBAdapter
DBAdapter defines the interface for a Propel database adapter.
Support for new databases is added by subclassing
DBAdapter
and implementing its abstract interface, and by
registering the new database adapter and corresponding Propel
driver in the private adapters map (array) in this class.
The Propel database adapters exist to present a uniform interface to database access across all available databases. Once the necessary adapters have been written and configured, transparent swapping of databases is theoretically supported with zero code change and minimal configuration file modifications.
Constants
ID_METHOD_NONE |
|
ID_METHOD_AUTOINCREMENT |
|
ID_METHOD_SEQUENCE |
|
Methods
static DBAdapter |
factory(string $driver)
Creates a new instance of the database adapter associated with the specified Propel driver. |
||||||||||||||||
array |
prepareParams(array $settings)
Prepare connection parameters. |
||||||||||||||||
initConnection(PDO $con, array $settings)
This method is called after a connection was created to run necessary post-initialization queries or code. |
|||||||||||||||||
setCharset(PDO $con, string $charset)
Sets the character encoding using SQL standard SET NAMES statement. |
|||||||||||||||||
string |
toUpperCase(string $in)
This method is used to ignore case. |
||||||||||||||||
string |
getStringDelimiter()
Returns the character used to indicate the beginning and end of a piece of text used in a SQL statement (generally a single quote). |
||||||||||||||||
string |
ignoreCase(string $in)
This method is used to ignore case. |
||||||||||||||||
string |
ignoreCaseInOrderBy(string $in)
This method is used to ignore case in an ORDER BY clause. |
||||||||||||||||
string |
concatString(string $s1, string $s2)
Returns SQL which concatenates the second string to the first. |
||||||||||||||||
string |
subString(string $s, integer $pos, integer $len)
Returns SQL which extracts a substring. |
||||||||||||||||
string |
strLength(string $s)
Returns SQL which calculates the length (in chars) of a string. |
||||||||||||||||
string |
quoteIdentifier(string $text)
Quotes database objec identifiers (table names, col names, sequences, etc.). |
||||||||||||||||
string |
quoteIdentifierTable(string $table)
Quotes a database table which could have space separating it from an alias, both should be identified separately This doesn't take care of dots which separate schema names from table names. |
||||||||||||||||
boolean |
isGetIdBeforeInsert()
Whether this adapter uses an ID generation system that requires getting ID before performing INSERT. |
||||||||||||||||
boolean |
isGetIdAfterInsert()
Whether this adapter uses an ID generation system that requires getting ID before performing INSERT. |
||||||||||||||||
mixed |
getId(PDO $con, string $name = null)
Gets the generated ID (either last ID for autoincrement or next sequence ID). |
||||||||||||||||
string |
formatTemporalValue(mixed $value, mixed $type)
Formats a temporal value before binding, given a ColumnMap object. |
||||||||||||||||
string |
getTimestampFormatter()
Returns timestamp formatter string for use in date() function. |
||||||||||||||||
string |
getDateFormatter()
Returns date formatter string for use in date() function. |
||||||||||||||||
string |
getTimeFormatter()
Returns time formatter string for use in date() function. |
||||||||||||||||
useQuoteIdentifier()
Should Column-Names get identifiers for inserts or updates. |
|||||||||||||||||
cleanupSQL(string $sql, array $params, Criteria $values, DatabaseMap $dbMap)
Allows manipulation of the query string before PDOStatement is instantiated. |
|||||||||||||||||
applyLimit(string $sql, integer $offset, integer $limit)
Modifies the passed-in SQL to add LIMIT and/or OFFSET. |
|||||||||||||||||
random(mixed $seed = null)
Gets the SQL string that this adapter uses for getting a random number. |
|||||||||||||||||
string |
getDeleteFromClause(Criteria $criteria, string $tableName)
Returns the "DELETE FROM
Details
|