class MssqlAdapter extends PdoAdapter implements SqlAdapterInterface
This is used to connect to a MSSQL database.
Methods
PdoConnection |
getConnection(array $conparams)
Build database connection |
from PdoAdapter |
initConnection(ConnectionInterface $con, array $settings)
This method is called after a connection was created to run necessary post-initialization queries or code. |
from PdoAdapter | |
setCharset(ConnectionInterface $con, string $charset)
MS SQL Server does not support SET NAMES |
||
string |
toUpperCase(string $in)
This method is used to ignore case. |
from PdoAdapter |
string |
ignoreCase(string $in)
This method is used to ignore case. |
from PdoAdapter |
string |
ignoreCaseInOrderBy(string $in)
This method is used to ignore case in an ORDER BY clause. |
from PdoAdapter |
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). |
from PdoAdapter |
string | quoteIdentifier(string $text) | |
string | quoteIdentifierTable(string $table) | |
boolean |
isGetIdBeforeInsert()
Whether this adapter uses an ID generation system that requires getting ID _before_ performing INSERT. |
from PdoAdapter |
boolean |
isGetIdAfterInsert()
Whether this adapter uses an ID generation system that requires getting ID _before_ performing INSERT. |
from PdoAdapter |
mixed |
getId(ConnectionInterface $con, string $name = null)
Gets the generated ID (either last ID for autoincrement or next sequence ID). |
from PdoAdapter |
string |
formatTemporalValue(mixed $value, ColumnMap $cMap)
Formats a temporal value before binding, given a ColumnMap object |
from PdoAdapter |
string |
getTimestampFormatter()
Returns timestamp formatter string for use in date() function. |
from PdoAdapter |
string |
getDateFormatter()
Returns date formatter string for use in date() function. |
from PdoAdapter |
string |
getTimeFormatter()
Returns time formatter string for use in date() function. |
from PdoAdapter |
useQuoteIdentifier()
Should Column-Names get identifiers for inserts or updates. |
from PdoAdapter | |
cleanupSQL(string $sql, array $params, Criteria $values, DatabaseMap $dbMap) | ||
string |
getDeleteFromClause(Criteria $criteria, string $tableName)
Returns the "DELETE FROM <table> [AS <alias>]" part of DELETE query. |
from PdoAdapter |
string |
createSelectSqlPart(Criteria $criteria, array $fromClause, boolean $aliasAll = false)
Builds the SELECT part of a SQL statement based on a Criteria taking into account select columns and 'as' columns (i.e. |
from PdoAdapter |
Criteria |
turnSelectColumnsToAliases(Criteria $criteria)
Ensures uniqueness of select column names by turning them all into aliases This is necessary for queries on more than one table when the tables share a column name |
from PdoAdapter |
bindValues(StatementInterface $stmt, array $params, DatabaseMap $dbMap)
Binds values in a prepared statement. |
from PdoAdapter | |
boolean |
bindValue(StatementInterface $stmt, string $parameter, mixed $value, ColumnMap $cMap, null|integer $position = null)
Binds a value to a positioned parameter in a statement, given a ColumnMap object to infer the binding type. |
from PdoAdapter |
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 | random(string $seed = null) | |
void |
applyLimit(string $sql, integer $offset, integer $limit)
Simulated Limit/Offset |
Details
in PdoAdapter at line 40
public PdoConnection
getConnection(array $conparams)
Build database connection
in PdoAdapter at line 104
public
initConnection(ConnectionInterface $con, array $settings)
This method is called after a connection was created to run necessary post-initialization queries or code.
If a charset was specified, this will be set before any other queries
are executed.
This base method runs queries specified using the "query" setting.
at line 36
public
setCharset(ConnectionInterface $con, string $charset)
MS SQL Server does not support SET NAMES
in PdoAdapter at line 141
public string
toUpperCase(string $in)
This method is used to ignore case.
in PdoAdapter at line 152
public string
ignoreCase(string $in)
This method is used to ignore case.
in PdoAdapter at line 166
public string
ignoreCaseInOrderBy(string $in)
This method is used to ignore case in an ORDER BY clause.
Usually it is the same as ignoreCase, but some databases
(Interbase for example) does not use the same SQL in ORDER BY
and other clauses.
in PdoAdapter at line 178
public 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).
at line 84
public string
quoteIdentifier(string $text)
at line 95
public string
quoteIdentifierTable(string $table)
in PdoAdapter at line 222
public boolean
isGetIdBeforeInsert()
Whether this adapter uses an ID generation system that requires getting ID _before_ performing INSERT.
in PdoAdapter at line 232
public boolean
isGetIdAfterInsert()
Whether this adapter uses an ID generation system that requires getting ID _before_ performing INSERT.
in PdoAdapter at line 245
public mixed
getId(ConnectionInterface $con, string $name = null)
Gets the generated ID (either last ID for autoincrement or next sequence ID).
in PdoAdapter at line 258
public string
formatTemporalValue(mixed $value, ColumnMap $cMap)
Formats a temporal value before binding, given a ColumnMap object
in PdoAdapter at line 285
public string
getTimestampFormatter()
Returns timestamp formatter string for use in date() function.
in PdoAdapter at line 295
public string
getDateFormatter()
Returns date formatter string for use in date() function.
in PdoAdapter at line 305
public string
getTimeFormatter()
Returns time formatter string for use in date() function.
in PdoAdapter at line 320
public
useQuoteIdentifier()
Should Column-Names get identifiers for inserts or updates.
By default false is returned -> backwards compatibility.
it`s a workaround...!!!
at line 258
public
cleanupSQL(string $sql, array $params, Criteria $values, DatabaseMap $dbMap)
in PdoAdapter at line 345
public string
getDeleteFromClause(Criteria $criteria, string $tableName)
Returns the "DELETE FROM <table> [AS <alias>]" part of DELETE query.
in PdoAdapter at line 377
public string
createSelectSqlPart(Criteria $criteria, array $fromClause, boolean $aliasAll = false)
Builds the SELECT part of a SQL statement based on a Criteria taking into account select columns and 'as' columns (i.e.
columns aliases)
in PdoAdapter at line 448
public Criteria
turnSelectColumnsToAliases(Criteria $criteria)
Ensures uniqueness of select column names by turning them all into aliases This is necessary for queries on more than one table when the tables share a column name
in PdoAdapter at line 498
public
bindValues(StatementInterface $stmt, array $params, DatabaseMap $dbMap)
Binds values in a prepared statement.
This method is designed to work with the Criteria::createSelectSql() method, which creates
both the SELECT SQL statement and populates a passed-in array of parameter
values that should be substituted.
<code>
$adapter = Propel::getServiceContainer()->getAdapter($criteria->getDbName());
$sql = $criteria->createSelectSql($params);
$stmt = $con->prepare($sql);
$params = array();
$adapter->populateStmtValues($stmt, $params, Propel::getServiceContainer()->getDatabaseMap($critera->getDbName()));
$stmt->execute();
</code>
in PdoAdapter at line 532
public boolean
bindValue(StatementInterface $stmt, string $parameter, mixed $value, ColumnMap $cMap, null|integer $position = null)
Binds a value to a positioned parameter in a statement, given a ColumnMap object to infer the binding type.
at line 48
public string
concatString(string $s1, string $s2)
Returns SQL which concatenates the second string to the first.
at line 62
public string
subString(string $s, integer $pos, integer $len)
Returns SQL which extracts a substring.
at line 73
public string
strLength(string $s)
Returns SQL which calculates the length (in chars) of a string.
at line 107
public string
random(string $seed = null)
at line 127
public void
applyLimit(string $sql, integer $offset, integer $limit)
Simulated Limit/Offset
This rewrites the $sql query to apply the offset and limit.
some of the ORDER BY logic borrowed from Doctrine MsSqlPlatform