Skip to content

Commit 645b690

Browse files
authored
Remove SchemaInterface::isReadQuery() method (#846)
1 parent ca37aa1 commit 645b690

4 files changed

Lines changed: 3 additions & 20 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
- Enh #842: Allow `ExpressionInterface` for `$alias` parameter of `QueryPartsInterface::withQuery()` method (@Tigrov)
2525
- Enh #843: Remove `AbstractPdoCommand::logQuery()` method (@Tigrov)
2626
- Chg #845: Remove `AbstractSchema::normalizeRowKeyCase()` method (@Tigrov)
27+
- Chg #846: Remove `SchemaInterface::isReadQuery()` method (@Tigrov)
2728

2829
## 1.3.0 March 21, 2024
2930

UPGRADE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ $db->createCommand()->insertBatch('user', $values)->execute();
6565

6666
- `AbstractDMLQueryBuilder::getTypecastValue()`
6767
- `TableSchemaInterface::compositeForeignKey()`
68+
- `SchemaInterface::isReadQuery()`
69+
- `AbstractSchema::isReadQuery()`
6870
- `AbstractSchema::normalizeRowKeyCase()`
6971
- `Quoter::unquoteParts()`
7072
- `AbstractPdoCommand::logQuery()`

src/Schema/AbstractSchema.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use function gettype;
1717
use function is_array;
18-
use function preg_match;
1918
use function preg_replace;
2019
use function str_contains;
2120
use function str_replace;
@@ -314,14 +313,6 @@ public function getTableUniques(string $name, bool $refresh = false): array
314313
return is_array($tableUniques) ? $tableUniques : [];
315314
}
316315

317-
/** @deprecated Use {@see DbStringHelper::isReadQuery()}. Will be removed in version 2.0.0. */
318-
public function isReadQuery(string $sql): bool
319-
{
320-
$pattern = '/^\s*(SELECT|SHOW|DESCRIBE)\b/i';
321-
322-
return preg_match($pattern, $sql) > 0;
323-
}
324-
325316
/**
326317
* @throws InvalidArgumentException
327318
*/

src/Schema/SchemaInterface.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -357,17 +357,6 @@ public function getTableSchema(string $name, bool $refresh = false): TableSchema
357357
*/
358358
public function getTableSchemas(string $schema = '', bool $refresh = false): array;
359359

360-
/**
361-
* Returns a value indicating whether an SQL statement is for read purpose.
362-
*
363-
* @param string $sql The SQL statement.
364-
*
365-
* @return bool Whether an SQL statement is for read purpose.
366-
*
367-
* @deprecated Use {@see DbStringHelper::isReadQuery()}. Will be removed in version 2.0.0.
368-
*/
369-
public function isReadQuery(string $sql): bool;
370-
371360
/**
372361
* Refreshes the schema.
373362
*

0 commit comments

Comments
 (0)