Skip to content

Commit

Permalink
Remove full qualified table name check
Browse files Browse the repository at this point in the history
  • Loading branch information
kitloong committed Aug 3, 2024
1 parent b890ed5 commit 1011f8c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/Repositories/SQLSrvRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,14 @@ public function getUserDefinedTypes(): Collection
/**
* Returns the where clause to filter schema and table name in a query.
*
* @param string $table The full qualified name of the table.
* @param string $table The name of the table.
* @param string $schemaColumn The name of the column to compare the schema to in the where clause.
* @param string $tableColumn The name of the column to compare the table to in the where clause.
*/
private function getTableWhereClause(string $table, string $schemaColumn, string $tableColumn): string
{
$schema = 'SCHEMA_NAME()';

if (str_contains($table, '.')) {
[$schema, $table] = explode('.', $table);
$schema = $this->quoteStringLiteral($schema);
}

$table = $this->quoteStringLiteral($table);

return sprintf('(%s = %s AND %s = %s)', $tableColumn, $table, $schemaColumn, $schema);
Expand Down

0 comments on commit 1011f8c

Please sign in to comment.