Skip to content

Commit

Permalink
Remove SchemaInterface::isReadQuery() method
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed May 10, 2024
1 parent ca37aa1 commit d45ecdd
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ $db->createCommand()->insertBatch('user', $values)->execute();

- `AbstractDMLQueryBuilder::getTypecastValue()`
- `TableSchemaInterface::compositeForeignKey()`
- `SchemaInterface::isReadQuery()`
- `AbstractSchema::isReadQuery()`
- `AbstractSchema::normalizeRowKeyCase()`
- `Quoter::unquoteParts()`
- `AbstractPdoCommand::logQuery()`
Expand Down
8 changes: 0 additions & 8 deletions src/Schema/AbstractSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,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
*/
Expand Down
11 changes: 0 additions & 11 deletions src/Schema/SchemaInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit d45ecdd

Please sign in to comment.