Skip to content

Conversation

@nickvergessen
Copy link
Member

@nickvergessen nickvergessen commented Jun 28, 2024

🔴 Platform requirements

  • Removed support for Oracle 12c (12.2.0.1) and older
  • Removed support for MariaDB 10.4.2 and older
  • Removed support for MySQL 5.6 and older
  • Removed active support for Postgres 9

⛑️ Need Help

⚠️ Breaking API changes

  • Doctrine\DBAL\Platforms\SqlitePlatform was renamed, use \OCP\IDBConnection::getDatabaseProvider() instead
  • Doctrine\DBAL\Platforms\PostgreSQL94Platform was removed, use \OCP\IDBConnection::getDatabaseProvider() instead
  • \OCP\DB\IQueryBuilder::getQueryParts() and \OCP\DB\IQueryBuilder::getQueryPart() were removed
  • \OCP\DB\IQueryBuilder::resetQueryParts() and \OCP\DB\IQueryBuilder::resetQueryPart() can only reset 'where'|'having'|'orderBy'|'groupBy'. For all other cases a new querybuilder has to be created.
  • Doctrine\DBAL\Types\Type::getName() aka. $column->getType()->getName() was removed is removed, use newly added \OCP\DB\Types::getType($column->getType())
  • Doctrine\DBAL\Schema\Table::changeColumn() was removed, use Table::modifyColumn() instead
  • Doctrine\DBAL\Schema\Table::hasPrimaryKey() was removed, use Table::getPrimaryKey() instead
  • Doctrine\DBAL\Schema\Schema::getTableNames() was removed, use OCP\DB\ISchemaWrapper::getTableNames() instead
  • Doctrine\DBAL\Connection::getSchemaManager() was removed, use Connection::createSchemaManager() instead
  • Doctrine\DBAL\FetchMode was removed, please use the dedicated fetch methods instead
  • \OCP\DB\IQueryBuilder::delete() and \OCP\DB\IQueryBuilder::update() no longer support table alias
  • Doctrine\DBAL\Platforms\MySQL80Platform requires the length of a VARCHAR column to be specified - 255 was added
  • OCP\DB\IPreparedStatement::bindParam() is deprecated and calls bindValue() internally
  • OCP\Diagnostics\IQueryLogger no longer extends \Doctrine\DBAL\Logging\SQLLogger
  • OCP\Diagnostics\IQuery data structure is now typed and the structure of the data can have changed depending on the type of the query due to upstream changes
  • OCP\DB\QueryBuilder\IExpressionBuilder::orX() and OCP\DB\QueryBuilder\IExpressionBuilder::andX() can no longer be called without arguments. Create an array outside and only create the composition once you know your entries.
  • Affected row counts are limited to PHP_INT_MAX

Checklist

@susnux

This comment was marked as outdated.

@nickvergessen

This comment was marked as outdated.

@nickvergessen nickvergessen force-pushed the dependabot/composer/doctrine/dbal-4.0.4 branch from f305046 to 3b4d652 Compare July 1, 2024 09:34
@susnux

This comment was marked as outdated.

@nickvergessen

This comment was marked as outdated.

@nickvergessen nickvergessen force-pushed the dependabot/composer/doctrine/dbal-4.0.4 branch from ab5e08c to a42453f Compare July 4, 2024 09:33
@nickvergessen nickvergessen requested a review from tcitworld as a code owner July 4, 2024 09:33
Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the bit of bikeshedding 🙂

*
* @param string $queryPartName
*
* @return mixed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @return mixed
* @return never

$result = $query->execute();
$result = $query->executeQuery();
$canCreateRoles = $result->rowCount() > 0;
} catch (DatabaseException $e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iirc execute and executeQuery do not throw the same class and this needs to be adapted, same for other similar changes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* @return IResult|int
* @throws Exception since 21.0.0
* @since 8.2.0
* @deprecated 22.0.0 Use executeQuery or executeStatement
*/
public function execute();

🆒 how the docs are lying then...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are not, you do need to use executeQuery, but you also need to adapt catch to the wrapped Exception.
I checked and DatabaseException is not part of the wrapped ones, only the dbal exception get wrapped so you should be fine.

…fierQuoteCharacter()` does not exist

Signed-off-by: Joas Schilling <[email protected]>
…tBitAndComparisonExpression` expects string

Signed-off-by: Joas Schilling <[email protected]>
…calls `bindValue()` internally

Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
…on\ExpressionBuilder::or()`, 0 passed and atleast 1 expected

Signed-off-by: Joas Schilling <[email protected]>
@nickvergessen nickvergessen force-pushed the dependabot/composer/doctrine/dbal-4.0.4 branch from a42453f to 5fdc5d5 Compare July 4, 2024 12:23
}

/**
* @return self::PLATFORM_MYSQL|self::PLATFORM_ORACLE|self::PLATFORM_POSTGRES|self::PLATFORM_SQLITE

Check failure

Code scanning / Psalm

MoreSpecificReturnType

The declared return type ''mysql'|'oracle'|'postgres'|'sqlite'' for OC\DB\ConnectionAdapter::getDatabaseProvider is more specific than the inferred return type 'string'
} else {
throw new \Exception('Database ' . $platform::class . ' not supported');
}
return $this->inner->getDatabaseProvider();

Check failure

Code scanning / Psalm

LessSpecificReturnStatement

The type 'string' is more general than the declared return type ''mysql'|'oracle'|'postgres'|'sqlite'' for OC\DB\ConnectionAdapter::getDatabaseProvider
use OCP\DB\QueryBuilder\IQueryBuilder;

trait TDoctrineParameterTypeMap {
protected function convertParameterTypeToDoctrine(ArrayParameterType|ParameterType|string|int|null $type): ArrayParameterType|ParameterType|string {

Check failure

Code scanning / Psalm

InvalidReturnType

The declared return type 'Doctrine\DBAL\ArrayParameterType|Doctrine\DBAL\ParameterType|string' for OC\DB\TDoctrineParameterTypeMap::convertParameterTypeToDoctrine is incorrect, got 'Doctrine\DBAL\ArrayParameterType|Doctrine\DBAL\ParameterType|int|string'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants