diff --git a/CHANGELOG.md b/CHANGELOG.md index e6a38681e..d122482a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ - Enh #842: Allow `ExpressionInterface` for `$alias` parameter of `QueryPartsInterface::withQuery()` method (@Tigrov) - Enh #843: Remove `AbstractPdoCommand::logQuery()` method (@Tigrov) - Chg #845: Remove `AbstractSchema::normalizeRowKeyCase()` method (@Tigrov) +- Chg #846: Remove `SchemaInterface::isReadQuery()` method (@Tigrov) ## 1.3.0 March 21, 2024 diff --git a/UPGRADE.md b/UPGRADE.md index b25882c84..a342f7ef4 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -65,6 +65,8 @@ $db->createCommand()->insertBatch('user', $values)->execute(); - `AbstractDMLQueryBuilder::getTypecastValue()` - `TableSchemaInterface::compositeForeignKey()` +- `SchemaInterface::isReadQuery()` +- `AbstractSchema::isReadQuery()` - `AbstractSchema::normalizeRowKeyCase()` - `Quoter::unquoteParts()` - `AbstractPdoCommand::logQuery()` diff --git a/src/Schema/AbstractSchema.php b/src/Schema/AbstractSchema.php index 54915a9bf..368cb8d71 100644 --- a/src/Schema/AbstractSchema.php +++ b/src/Schema/AbstractSchema.php @@ -15,7 +15,6 @@ use function gettype; use function is_array; -use function preg_match; use function preg_replace; use function str_contains; use function str_replace; @@ -314,14 +313,6 @@ public function getTableUniques(string $name, bool $refresh = false): array return is_array($tableUniques) ? $tableUniques : []; } - /** @deprecated Use {@see DbStringHelper::isReadQuery()}. Will be removed in version 2.0.0. */ - public function isReadQuery(string $sql): bool - { - $pattern = '/^\s*(SELECT|SHOW|DESCRIBE)\b/i'; - - return preg_match($pattern, $sql) > 0; - } - /** * @throws InvalidArgumentException */ diff --git a/src/Schema/SchemaInterface.php b/src/Schema/SchemaInterface.php index 73d0893e0..1a5b675c3 100644 --- a/src/Schema/SchemaInterface.php +++ b/src/Schema/SchemaInterface.php @@ -357,17 +357,6 @@ public function getTableSchema(string $name, bool $refresh = false): TableSchema */ public function getTableSchemas(string $schema = '', bool $refresh = false): array; - /** - * Returns a value indicating whether an SQL statement is for read purpose. - * - * @param string $sql The SQL statement. - * - * @return bool Whether an SQL statement is for read purpose. - * - * @deprecated Use {@see DbStringHelper::isReadQuery()}. Will be removed in version 2.0.0. - */ - public function isReadQuery(string $sql): bool; - /** * Refreshes the schema. *