Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SchemaInterface::isReadQuery() method #846

Merged
merged 2 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
9 changes: 0 additions & 9 deletions src/Schema/AbstractSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
*/
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
Loading