Closed Tigrov closed 1 year ago
Refactoring of Quoter class
This update makes a few changes to improve the Quoter
class, which is responsible for creating and managing SQL (a type of programming language) statements. This includes handling special characters in column names, and managing table names that have aliases (which is like a nickname for the table).
New QuoteSql method
A new method called quoteSql()
is introduced. This addition makes sure SQL statements are correctly formatted.
Updates to existing methods
The updates also improve existing methods, like quoteColumnName()
and unquoteSimpleColumnName()
. Now they can handle special characters more efficiently. The cleanUpTableNames()
and quoteTableName()
methods have also been improved to manage table names with aliases, sub-queries and different quote formats more effectively.
New Tests
We've also added a few new tests in QuoterTest
class to check these changes are working correctly. Among others, these tests check that SQL statements with table prefixes and table names with query aliases are handled properly. This ensures the high quality and reliability of the updated code.
All modified lines are covered by tests :white_check_mark:
Comparison is base (
fb4c084
) 99.73% compared to head (63bccfb
) 99.73%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
use function
blockstr_contains()
withstr_starts_with()
quoteSql()
for sql containing table with prefix (test)getTableNameParts()
for cases with different quotes for tables and columns (test)quoteTableName()
for sub-query with alias (test)