_id stringlengths 2 7 | title stringlengths 3 151 | partition stringclasses 3
values | text stringlengths 33 8k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q16600 | Statement.bindParam | train | public function bindParam($name, &$var, $type = ParameterType::STRING, $length = null)
{
$this->params[$name] = $var;
$this->types[$name] = | php | {
"resource": ""
} |
q16601 | Statement.execute | train | public function execute($params = null)
{
if (is_array($params)) {
$this->params = $params;
}
$logger = $this->conn->getConfiguration()->getSQLLogger();
if ($logger) {
$logger->startQuery($this->sql, $this->params, $this->types);
}
try {
... | php | {
"resource": ""
} |
q16602 | SQLAnywherePlatform.getAlterTableAddColumnClause | train | protected function getAlterTableAddColumnClause(Column $column)
{
return 'ADD ' . | php | {
"resource": ""
} |
q16603 | SQLAnywherePlatform.getAlterTableRenameColumnClause | train | protected function getAlterTableRenameColumnClause($oldColumnName, Column $column)
{
$oldColumnName = | php | {
"resource": ""
} |
q16604 | SQLAnywherePlatform.getAlterTableChangeColumnClause | train | protected function getAlterTableChangeColumnClause(ColumnDiff $columnDiff)
{
$column = $columnDiff->column;
// Do not return alter clause if only comment has changed.
if (! ($columnDiff->hasChanged('comment') && count($columnDiff->changedProperties) === 1)) {
$columnAlterationCl... | php | {
"resource": ""
} |
q16605 | SQLAnywherePlatform.getForeignKeyMatchClauseSQL | train | public function getForeignKeyMatchClauseSQL($type)
{
switch ((int) $type) {
case self::FOREIGN_KEY_MATCH_SIMPLE:
return 'SIMPLE';
break;
case self::FOREIGN_KEY_MATCH_FULL:
return 'FULL';
break;
case self::F... | php | {
"resource": ""
} |
q16606 | SQLAnywherePlatform.getPrimaryKeyDeclarationSQL | train | public function getPrimaryKeyDeclarationSQL(Index $index, $name = null)
{
if (! $index->isPrimary()) {
throw new InvalidArgumentException(
'Can only | php | {
"resource": ""
} |
q16607 | SQLAnywherePlatform.getAdvancedIndexOptionsSQL | train | protected function getAdvancedIndexOptionsSQL(Index $index)
{
$sql = '';
if (! $index->isPrimary() && $index->hasFlag('for_olap_workload')) {
| php | {
"resource": ""
} |
q16608 | SQLAnywherePlatform.getTableConstraintDeclarationSQL | train | protected function getTableConstraintDeclarationSQL(Constraint $constraint, $name = null)
{
if ($constraint instanceof ForeignKeyConstraint) {
return $this->getForeignKeyDeclarationSQL($constraint);
}
if (! $constraint instanceof Index) {
throw new InvalidArgumentExc... | php | {
"resource": ""
} |
q16609 | SQLAzureShardManager.splitFederation | train | public function splitFederation($splitDistributionValue)
{
$type = Type::getType($this->distributionType);
$sql = 'ALTER FEDERATION ' . $this->getFederationName() . ' ' .
'SPLIT AT (' . $this->getDistributionKey() . ' = ' .
| php | {
"resource": ""
} |
q16610 | Version.compare | train | public static function compare($version)
{
$currentVersion = str_replace(' ', '', strtolower(self::VERSION));
$version = str_replace(' | php | {
"resource": ""
} |
q16611 | PoolingShardConnection.connect | train | public function connect($shardId = null)
{
if ($shardId === null && $this->_conn) {
return false;
}
if ($shardId !== null && $shardId === $this->activeShardId) {
return false;
}
if ($this->getTransactionNestingLevel() > 0) {
throw new Sha... | php | {
"resource": ""
} |
q16612 | Connection.connect | train | public function connect()
{
if ($this->isConnected) {
return false;
}
$driverOptions = $this->params['driverOptions'] ?? [];
$user = $this->params['user'] ?? null;
$password = $this->params['password'] ?? null;
$this->_conn = $this->_... | php | {
"resource": ""
} |
q16613 | Connection.detectDatabasePlatform | train | private function detectDatabasePlatform()
{
$version = $this->getDatabasePlatformVersion();
if ($version !== null) {
assert($this->_driver instanceof VersionAwarePlatformDriver);
$this->platform = $this->_driver->createDatabasePlatformForVersion($version);
} else {
... | php | {
"resource": ""
} |
q16614 | Connection.getDatabasePlatformVersion | train | private function getDatabasePlatformVersion()
{
// Driver does not support version specific platforms.
if (! $this->_driver instanceof VersionAwarePlatformDriver) {
return null;
}
// Explicit platform version requested (supersedes auto-detection).
if (isset($this... | php | {
"resource": ""
} |
q16615 | Connection.getServerVersion | train | private function getServerVersion()
{
$connection = $this->getWrappedConnection();
// Automatic platform version detection.
if ($connection instanceof ServerInfoAwareConnection && ! $connection->requiresQueryForServerVersion()) {
| php | {
"resource": ""
} |
q16616 | Connection.setAutoCommit | train | public function setAutoCommit($autoCommit)
{
$autoCommit = (bool) $autoCommit;
// Mode not changed, no-op.
if ($autoCommit === $this->autoCommit) {
return;
}
$this->autoCommit = $autoCommit;
// Commit all currently active transactions | php | {
"resource": ""
} |
q16617 | Connection.fetchAssoc | train | public function fetchAssoc($statement, array $params = [], array $types = [])
{
| php | {
"resource": ""
} |
q16618 | Connection.fetchArray | train | public function fetchArray($statement, array $params = [], array $types = []) | php | {
"resource": ""
} |
q16619 | Connection.addIdentifierCondition | train | private function addIdentifierCondition(
array $identifier,
array &$columns,
array &$values,
array &$conditions
) : void {
$platform = $this->getDatabasePlatform();
foreach ($identifier as $columnName => $value) {
if ($value === null) {
| php | {
"resource": ""
} |
q16620 | Connection.delete | train | public function delete($tableExpression, array $identifier, array $types = [])
{
if (empty($identifier)) {
throw InvalidArgumentException::fromEmptyCriteria();
}
$columns = $values = $conditions = [];
$this->addIdentifierCondition($identifier, $columns, $values, $condit... | php | {
"resource": ""
} |
q16621 | Connection.setTransactionIsolation | train | public function setTransactionIsolation($level)
{
$this->transactionIsolationLevel = $level;
| php | {
"resource": ""
} |
q16622 | Connection.getTransactionIsolation | train | public function getTransactionIsolation()
{
if ($this->transactionIsolationLevel === null) {
$this->transactionIsolationLevel = | php | {
"resource": ""
} |
q16623 | Connection.update | train | public function update($tableExpression, array $data, array $identifier, array $types = [])
{
$columns = $values = $conditions = $set = [];
foreach ($data as $columnName => $value) {
$columns[] = $columnName;
$values[] = $value;
$set[] = $columnName . ' = ?'... | php | {
"resource": ""
} |
q16624 | Connection.extractTypeValues | train | private function extractTypeValues(array $columnList, array $types)
{
$typeValues = [];
foreach ($columnList as $columnIndex => $columnName) {
| php | {
"resource": ""
} |
q16625 | Connection.fetchAll | train | public function fetchAll($sql, array $params = [], $types = []) | php | {
"resource": ""
} |
q16626 | Connection.executeQuery | train | public function executeQuery($query, array $params = [], $types = [], ?QueryCacheProfile $qcp = null)
{
if ($qcp !== null) {
return $this->executeCacheQuery($query, $params, $types, $qcp);
}
$connection = $this->getWrappedConnection();
$logger = $this->_config->getSQLLo... | php | {
"resource": ""
} |
q16627 | Connection.executeCacheQuery | train | public function executeCacheQuery($query, $params, $types, QueryCacheProfile $qcp)
{
$resultCache = $qcp->getResultCacheDriver() ?? $this->_config->getResultCacheImpl();
if ($resultCache === null) {
throw CacheException::noResultDriverConfigured();
}
$connectionParams =... | php | {
"resource": ""
} |
q16628 | Connection.exec | train | public function exec($statement)
{
$connection = $this->getWrappedConnection();
$logger = $this->_config->getSQLLogger();
if ($logger) {
$logger->startQuery($statement);
}
try {
$result = $connection->exec($statement);
| php | {
"resource": ""
} |
q16629 | Connection.setNestTransactionsWithSavepoints | train | public function setNestTransactionsWithSavepoints($nestTransactionsWithSavepoints)
{
if ($this->transactionNestingLevel > 0) {
throw ConnectionException::mayNotAlterNestedTransactionWithSavepointsInTransaction();
| php | {
"resource": ""
} |
q16630 | Connection.commitAll | train | private function commitAll()
{
while ($this->transactionNestingLevel !== 0) {
if ($this->autoCommit === false && $this->transactionNestingLevel === 1) {
// When in no auto-commit mode, the last nesting commit immediately starts a new transaction.
// Therefore we n... | php | {
"resource": ""
} |
q16631 | Connection.rollBack | train | public function rollBack()
{
if ($this->transactionNestingLevel === 0) {
throw ConnectionException::noActiveTransaction();
}
$connection = $this->getWrappedConnection();
$logger = $this->_config->getSQLLogger();
if ($this->transactionNestingLevel === 1) {
... | php | {
"resource": ""
} |
q16632 | Connection.createSavepoint | train | public function createSavepoint($savepoint)
{
if (! $this->getDatabasePlatform()->supportsSavepoints()) {
| php | {
"resource": ""
} |
q16633 | Connection.releaseSavepoint | train | public function releaseSavepoint($savepoint)
{
if (! $this->getDatabasePlatform()->supportsSavepoints()) {
throw ConnectionException::savepointsNotSupported();
| php | {
"resource": ""
} |
q16634 | Connection.rollbackSavepoint | train | public function rollbackSavepoint($savepoint)
{
if (! $this->getDatabasePlatform()->supportsSavepoints()) {
| php | {
"resource": ""
} |
q16635 | Connection.getSchemaManager | train | public function getSchemaManager()
{
if ($this->_schemaManager === null) {
| php | {
"resource": ""
} |
q16636 | Connection.convertToDatabaseValue | train | public function convertToDatabaseValue($value, $type)
{
| php | {
"resource": ""
} |
q16637 | Connection._bindTypedValues | train | private function _bindTypedValues($stmt, array $params, array $types)
{
// Check whether parameters are positional or named. Mixing is not allowed, just like in PDO.
if (is_int(key($params))) {
// Positional parameters
$typeOffset = array_key_exists(0, $types) ? -1 : 0;
... | php | {
"resource": ""
} |
q16638 | Connection.getBindingInfo | train | private function getBindingInfo($value, $type)
{
if (is_string($type)) {
$type = Type::getType($type);
}
if ($type instanceof Type) {
$value = $type->convertToDatabaseValue($value, $this->getDatabasePlatform());
$bindingType | php | {
"resource": ""
} |
q16639 | Connection.resolveParams | train | public function resolveParams(array $params, array $types)
{
$resolvedParams = [];
// Check whether parameters are positional or named. Mixing is not allowed, just like in PDO.
if (is_int(key($params))) {
// Positional parameters
$typeOffset = array_key_exists(0, $ty... | php | {
"resource": ""
} |
q16640 | DB2Platform.gatherAlterColumnSQL | train | private function gatherAlterColumnSQL(Identifier $table, ColumnDiff $columnDiff, array &$sql, array &$queryParts)
{
$alterColumnClauses = $this->getAlterColumnClausesSQL($columnDiff);
if (empty($alterColumnClauses)) {
return;
}
// If we have a single column alteration, ... | php | {
"resource": ""
} |
q16641 | DB2Platform.getAlterColumnClausesSQL | train | private function getAlterColumnClausesSQL(ColumnDiff $columnDiff)
{
$column = $columnDiff->column->toArray();
$alterClause = 'ALTER COLUMN ' . $columnDiff->column->getQuotedName($this);
if ($column['columnDefinition']) {
return [$alterClause . ' ' . $column['columnDefinition']]... | php | {
"resource": ""
} |
q16642 | CompositeExpression.add | train | public function add($part)
{
if (empty($part)) {
return $this;
}
if ($part instanceof self && count($part) === 0) {
| php | {
"resource": ""
} |
q16643 | AbstractPlatform.initializeAllDoctrineTypeMappings | train | private function initializeAllDoctrineTypeMappings()
{
$this->initializeDoctrineTypeMappings();
foreach (Type::getTypesMap() as $typeName => $className) {
foreach | php | {
"resource": ""
} |
q16644 | AbstractPlatform.registerDoctrineTypeMapping | train | public function registerDoctrineTypeMapping($dbType, $doctrineType)
{
if ($this->doctrineTypeMapping === null) {
$this->initializeAllDoctrineTypeMappings();
}
if (! Types\Type::hasType($doctrineType)) {
throw DBALException::typeNotFound($doctrineType);
| php | {
"resource": ""
} |
q16645 | AbstractPlatform.getDoctrineTypeMapping | train | public function getDoctrineTypeMapping($dbType)
{
if ($this->doctrineTypeMapping === null) {
$this->initializeAllDoctrineTypeMappings();
}
$dbType = strtolower($dbType);
if (! isset($this->doctrineTypeMapping[$dbType])) {
| php | {
"resource": ""
} |
q16646 | AbstractPlatform.hasDoctrineTypeMappingFor | train | public function hasDoctrineTypeMappingFor($dbType)
{
if ($this->doctrineTypeMapping === null) {
$this->initializeAllDoctrineTypeMappings();
} | php | {
"resource": ""
} |
q16647 | AbstractPlatform.isCommentedDoctrineType | train | public function isCommentedDoctrineType(Type $doctrineType)
{
if ($this->doctrineTypeComments === null) {
$this->initializeCommentedDoctrineTypes();
}
| php | {
"resource": ""
} |
q16648 | AbstractPlatform.markDoctrineTypeCommented | train | public function markDoctrineTypeCommented($doctrineType)
{
if ($this->doctrineTypeComments === null) {
$this->initializeCommentedDoctrineTypes();
}
| php | {
"resource": ""
} |
q16649 | AbstractPlatform.getTrimExpression | train | public function getTrimExpression($str, $mode = TrimMode::UNSPECIFIED, $char = false)
{
$expression = '';
switch ($mode) {
case TrimMode::LEADING:
$expression = 'LEADING ';
break;
case TrimMode::TRAILING:
$expression = 'TRAILI... | php | {
"resource": ""
} |
q16650 | AbstractPlatform.getDropTableSQL | train | public function getDropTableSQL($table)
{
$tableArg = $table;
if ($table instanceof Table) {
$table = $table->getQuotedName($this);
}
if (! is_string($table)) {
throw new InvalidArgumentException('getDropTableSQL() expects $table parameter to be string or \D... | php | {
"resource": ""
} |
q16651 | AbstractPlatform.getDropIndexSQL | train | public function getDropIndexSQL($index, $table = null)
{
if ($index instanceof Index) {
$index = $index->getQuotedName($this);
} elseif (! is_string($index)) {
throw new InvalidArgumentException('AbstractPlatform::getDropIndexSQL() | php | {
"resource": ""
} |
q16652 | AbstractPlatform.getDropConstraintSQL | train | public function getDropConstraintSQL($constraint, $table)
{
if (! $constraint instanceof Constraint) {
$constraint = new Identifier($constraint);
}
if (! $table instanceof Table) {
$table = new Identifier($table);
}
| php | {
"resource": ""
} |
q16653 | AbstractPlatform.getDropForeignKeySQL | train | public function getDropForeignKeySQL($foreignKey, $table)
{
if (! $foreignKey instanceof ForeignKeyConstraint) {
$foreignKey = new Identifier($foreignKey);
}
if (! $table instanceof Table) {
$table = new Identifier($table);
| php | {
"resource": ""
} |
q16654 | AbstractPlatform.getInlineColumnCommentSQL | train | public function getInlineColumnCommentSQL($comment)
{
if (! $this->supportsInlineColumnComments()) {
throw DBALException::notSupported(__METHOD__);
| php | {
"resource": ""
} |
q16655 | AbstractPlatform._getCreateTableSQL | train | protected function _getCreateTableSQL($tableName, array $columns, array $options = [])
{
$columnListSql = $this->getColumnDeclarationListSQL($columns);
if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) {
foreach ($options['uniqueConstraints'] as $name =... | php | {
"resource": ""
} |
q16656 | AbstractPlatform.getCreateConstraintSQL | train | public function getCreateConstraintSQL(Constraint $constraint, $table)
{
if ($table instanceof Table) {
$table = $table->getQuotedName($this);
}
$query = 'ALTER TABLE ' . $table . ' ADD CONSTRAINT ' . $constraint->getQuotedName($this);
$columnList = '(' . implode(', ', ... | php | {
"resource": ""
} |
q16657 | AbstractPlatform.getCreateIndexSQL | train | public function getCreateIndexSQL(Index $index, $table)
{
if ($table instanceof Table) {
$table = $table->getQuotedName($this);
}
$name = $index->getQuotedName($this);
$columns = $index->getColumns();
if (count($columns) === 0) {
throw new InvalidA... | php | {
"resource": ""
} |
q16658 | AbstractPlatform.quoteIdentifier | train | public function quoteIdentifier($str)
{
if (strpos($str, '.') !== false) {
$parts = array_map([$this, 'quoteSingleIdentifier'], | php | {
"resource": ""
} |
q16659 | AbstractPlatform.getCreateForeignKeySQL | train | public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table)
{
if ($table instanceof Table) {
| php | {
"resource": ""
} |
q16660 | AbstractPlatform.getRenameIndexSQL | train | protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName)
{
return [
$this->getDropIndexSQL($oldIndexName, $tableName),
| php | {
"resource": ""
} |
q16661 | AbstractPlatform._getAlterTableIndexForeignKeySQL | train | protected function _getAlterTableIndexForeignKeySQL(TableDiff $diff)
{
return | php | {
"resource": ""
} |
q16662 | AbstractPlatform.getColumnDeclarationListSQL | train | public function getColumnDeclarationListSQL(array $fields)
{
$queryFields = [];
foreach ($fields as $fieldName => $field) {
$queryFields[] | php | {
"resource": ""
} |
q16663 | AbstractPlatform.getColumnDeclarationSQL | train | public function getColumnDeclarationSQL($name, array $field)
{
if (isset($field['columnDefinition'])) {
$columnDef = $this->getCustomTypeDeclarationSQL($field);
} else {
$default = $this->getDefaultValueDeclarationSQL($field);
$charset = isset($field['charset']) ... | php | {
"resource": ""
} |
q16664 | AbstractPlatform.getDecimalTypeDeclarationSQL | train | public function getDecimalTypeDeclarationSQL(array $columnDef)
{
$columnDef['precision'] = ! isset($columnDef['precision']) || empty($columnDef['precision'])
? 10 : $columnDef['precision'];
$columnDef['scale'] | php | {
"resource": ""
} |
q16665 | AbstractPlatform.getDefaultValueDeclarationSQL | train | public function getDefaultValueDeclarationSQL($field)
{
if (! isset($field['default'])) {
return empty($field['notnull']) ? ' DEFAULT NULL' : '';
}
$default = $field['default'];
if (! isset($field['type'])) {
return " DEFAULT '" . $default . "'";
}
... | php | {
"resource": ""
} |
q16666 | AbstractPlatform.getCheckDeclarationSQL | train | public function getCheckDeclarationSQL(array $definition)
{
$constraints = [];
foreach ($definition as $field => $def) {
if (is_string($def)) {
$constraints[] = 'CHECK (' . $def . ')';
} else {
if (isset($def['min'])) {
$con... | php | {
"resource": ""
} |
q16667 | AbstractPlatform.getUniqueConstraintDeclarationSQL | train | public function getUniqueConstraintDeclarationSQL($name, Index $index)
{
$columns = $index->getColumns();
$name = new Identifier($name);
if (count($columns) === 0) {
throw new InvalidArgumentException("Incomplete definition. 'columns' required.");
}
return | php | {
"resource": ""
} |
q16668 | AbstractPlatform.getIndexFieldDeclarationListSQL | train | public function getIndexFieldDeclarationListSQL($columnsOrIndex) : string
{
if ($columnsOrIndex instanceof Index) {
return implode(', ', $columnsOrIndex->getQuotedColumns($this));
}
if (! is_array($columnsOrIndex)) {
| php | {
"resource": ""
} |
q16669 | AbstractPlatform.getForeignKeyDeclarationSQL | train | public function getForeignKeyDeclarationSQL(ForeignKeyConstraint $foreignKey)
{
$sql = $this->getForeignKeyBaseDeclarationSQL($foreignKey);
| php | {
"resource": ""
} |
q16670 | AbstractPlatform.getAdvancedForeignKeyOptionsSQL | train | public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey)
{
$query = '';
if ($this->supportsForeignKeyOnUpdate() && $foreignKey->hasOption('onUpdate')) {
$query .= ' ON UPDATE ' . $this->getForeignKeyReferentialActionSQL($foreignKey->getOption('onUpdate'));
... | php | {
"resource": ""
} |
q16671 | AbstractPlatform.getForeignKeyBaseDeclarationSQL | train | public function getForeignKeyBaseDeclarationSQL(ForeignKeyConstraint $foreignKey)
{
$sql = '';
if (strlen($foreignKey->getName())) {
$sql .= 'CONSTRAINT ' . $foreignKey->getQuotedName($this) . ' ';
}
$sql .= 'FOREIGN KEY (';
if (count($foreignKey->getLocalColumns... | php | {
"resource": ""
} |
q16672 | AbstractPlatform.convertBooleans | train | public function convertBooleans($item)
{
if (is_array($item)) {
foreach ($item as $k => $value) {
if (! is_bool($value)) {
| php | {
"resource": ""
} |
q16673 | AbstractPlatform.modifyLimitQuery | train | final public function modifyLimitQuery($query, $limit, $offset = null)
{
if ($limit !== null) {
$limit = (int) $limit;
}
$offset = (int) $offset;
if ($offset < 0) {
throw new DBALException(sprintf(
'Offset must be a positive integer or zero, ... | php | {
"resource": ""
} |
q16674 | AbstractPlatform.doModifyLimitQuery | train | protected function doModifyLimitQuery($query, $limit, $offset)
{
if ($limit !== null) {
$query .= ' LIMIT ' . $limit;
}
if ($offset > 0) { | php | {
"resource": ""
} |
q16675 | AbstractPlatform.getReservedKeywordsList | train | final public function getReservedKeywordsList()
{
// Check for an existing instantiation of the keywords class.
if ($this->_keywords) {
return $this->_keywords;
}
$class = $this->getReservedKeywordsClass();
$keywords = new $class();
if (! $keywords ins... | php | {
"resource": ""
} |
q16676 | AbstractPlatform.quoteStringLiteral | train | public function quoteStringLiteral($str)
{
$c = $this->getStringLiteralQuoteCharacter();
| php | {
"resource": ""
} |
q16677 | AbstractPlatform.escapeStringForLike | train | final public function escapeStringForLike(string $inputString, string $escapeChar) : string
{
return preg_replace(
'~([' . preg_quote($this->getLikeWildcardCharacters() . $escapeChar, '~') | php | {
"resource": ""
} |
q16678 | DriverManager.getConnection | train | public static function getConnection(
array $params,
?Configuration $config = null,
?EventManager $eventManager = null
) : Connection {
// create default config and event manager, if not set
if (! $config) {
$config = new Configuration();
}
if (! $... | php | {
"resource": ""
} |
q16679 | DriverManager._checkParams | train | private static function _checkParams(array $params) : void
{
// check existence of mandatory parameters
// driver
if (! isset($params['driver']) && ! isset($params['driverClass'])) {
throw DBALException::driverRequired();
}
// check validity of parameters
... | php | {
"resource": ""
} |
q16680 | DriverManager.parseDatabaseUrl | train | private static function parseDatabaseUrl(array $params) : array
{
if (! isset($params['url'])) {
return $params;
}
// (pdo_)?sqlite3?:///... => (pdo_)?sqlite3?://localhost/... or else the URL will be invalid
$url = preg_replace('#^((?:pdo_)?sqlite3?):///#', '$1://localho... | php | {
"resource": ""
} |
q16681 | DriverManager.parseDatabaseUrlPath | train | private static function parseDatabaseUrlPath(array $url, array $params) : array
{
if (! isset($url['path'])) {
return $params;
}
$url['path'] = self::normalizeDatabaseUrlPath($url['path']);
// If we do not have a known DBAL driver, we do not know any connection URL path... | php | {
"resource": ""
} |
q16682 | DriverManager.parseDatabaseUrlQuery | train | private static function parseDatabaseUrlQuery(array $url, array $params) : array
{
if (! isset($url['query'])) {
return $params;
}
$query = [];
parse_str($url['query'], $query); // simply ingest query as extra | php | {
"resource": ""
} |
q16683 | DriverManager.parseSqliteDatabaseUrlPath | train | private static function parseSqliteDatabaseUrlPath(array $url, array $params) : array
{
if ($url['path'] === ':memory:') {
$params['memory'] = true;
return $params;
| php | {
"resource": ""
} |
q16684 | DriverManager.parseDatabaseUrlScheme | train | private static function parseDatabaseUrlScheme(array $url, array $params) : array
{
if (isset($url['scheme'])) {
// The requested driver from the URL scheme takes precedence
// over the default custom driver from the connection parameters (if any).
unset($params['driverCl... | php | {
"resource": ""
} |
q16685 | OracleSchemaManager.killUserSessions | train | private function killUserSessions($user)
{
$sql = <<<SQL
SELECT
s.sid,
s.serial#
FROM
gv\$session s,
gv\$process p
WHERE
s.username = ?
AND p.addr(+) = s.paddr
SQL;
$activeUserSessions = $this->_conn->fetchAll($sql, [strtoupper($user)]);
| php | {
"resource": ""
} |
q16686 | Driver._constructPdoDsn | train | private function _constructPdoDsn(array $params)
{
$dsn = 'ibm:';
if (isset($params['host'])) {
$dsn .= 'HOSTNAME=' . $params['host'] . ';';
}
if (isset($params['port'])) {
$dsn .= 'PORT=' . $params['port'] . ';';
| php | {
"resource": ""
} |
q16687 | CreateSchemaSqlCollector.getQueries | train | public function getQueries()
{
return array_merge(
$this->createNamespaceQueries,
$this->createTableQueries,
| php | {
"resource": ""
} |
q16688 | SQLSrvException.fromSqlSrvErrors | train | public static function fromSqlSrvErrors()
{
$message = '';
$sqlState = null;
$errorCode = null;
foreach ((array) sqlsrv_errors(SQLSRV_ERR_ERRORS) as $error) {
$message .= 'SQLSTATE [' . $error['SQLSTATE'] . ', ' . $error['code'] . ']: ' . $error['message'] . "\n";
... | php | {
"resource": ""
} |
q16689 | MySqlPlatform.getRemainingForeignKeyConstraintsRequiringRenamedIndexes | train | private function getRemainingForeignKeyConstraintsRequiringRenamedIndexes(TableDiff $diff)
{
if (empty($diff->renamedIndexes) || ! $diff->fromTable instanceof Table) {
return [];
}
$foreignKeys = [];
/** @var ForeignKeyConstraint[] $remainingForeignKeys */
$remai... | php | {
"resource": ""
} |
q16690 | SQLSrvStatement.prepare | train | private function prepare()
{
$params = [];
foreach ($this->variables as $column => &$variable) {
switch ($this->types[$column]) {
case ParameterType::LARGE_OBJECT:
$params[$column - 1] = [
&$variable,
SQ... | php | {
"resource": ""
} |
q16691 | ConversionException.conversionFailed | train | public static function conversionFailed($value, $toType)
{
$value = strlen($value) > 32 ? substr($value, 0, 20) . '...' : $value;
return new | php | {
"resource": ""
} |
q16692 | ConversionException.conversionFailedFormat | train | public static function conversionFailedFormat($value, $toType, $expectedFormat, ?Throwable $previous = null)
{
$value = strlen($value) > 32 ? substr($value, 0, 20) . '...' : $value;
return new self(
'Could not convert database value "' | php | {
"resource": ""
} |
q16693 | Configuration.setFilterSchemaAssetsExpression | train | public function setFilterSchemaAssetsExpression($filterExpression)
{
$this->_attributes['filterSchemaAssetsExpression'] = $filterExpression;
if ($filterExpression) { | php | {
"resource": ""
} |
q16694 | Index.spansColumns | train | public function spansColumns(array $columnNames)
{
$columns = $this->getColumns();
$numberOfColumns = count($columns);
$sameColumns = true;
for ($i = 0; $i < $numberOfColumns; $i++) {
| php | {
"resource": ""
} |
q16695 | Index.isFullfilledBy | train | public function isFullfilledBy(Index $other)
{
// allow the other index to be equally large only. It being larger is an option
// but it creates a problem with scenarios of the kind PRIMARY KEY(foo,bar) UNIQUE(foo)
if (count($other->getColumns()) !== count($this->getColumns())) {
... | php | {
"resource": ""
} |
q16696 | Index.overrules | train | public function overrules(Index $other)
{
if ($other->isPrimary()) {
return false;
}
if ($this->isSimpleIndex() && $other->isUnique()) {
return false;
}
return | php | {
"resource": ""
} |
q16697 | Index.samePartialIndex | train | private function samePartialIndex(Index $other)
{
if ($this->hasOption('where') && $other->hasOption('where') && $this->getOption('where') === $other->getOption('where')) {
return | php | {
"resource": ""
} |
q16698 | Index.hasSameColumnLengths | train | private function hasSameColumnLengths(self $other) : bool
{
$filter = static function (?int $length) : bool {
return $length !== null;
| php | {
"resource": ""
} |
q16699 | OraclePlatform.getSequenceCacheSQL | train | private function getSequenceCacheSQL(Sequence $sequence)
{
if ($sequence->getCache() === 0) {
return ' NOCACHE';
}
if ($sequence->getCache() === 1) {
return ' NOCACHE';
| php | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.