Remove use of dialect.LikeStr (#104460)

* Fix TestIntegrationUpdatingProvisionionedDashboards* tests when running on Spanner by fixing case-insensitive search for dashboard title.

* Fix use of case-insensitive LIKE when running on Spanner.

* Fix use of LikeStr in anonstore.

* Fix use of LikeStr in ngalert/store and org/orgimpl.

* Fix use of LikeStr in queryhistory search.

* Fix use of LikeStr in serviceaccounts.

* Fix use of LikeStr in serviceaccounts.

* Fix use of LikeStr in services/team.

* Remove LikeStr method.
This commit is contained in:
Peter Štibraný
2025-05-02 10:23:57 +02:00
committed by GitHub
parent d7ebaafa94
commit e85acf047a
16 changed files with 82 additions and 51 deletions
@@ -27,8 +27,6 @@ type Dialect interface {
ShowCreateNull() bool
SQLType(col *Column) string
SupportEngine() bool
// Deprecated. This doesn't work correctly for all databases.
LikeStr() string
// LikeOperator returns SQL snippet and query parameter for case-insensitive LIKE operation, with optional wildcards (%) before/after the pattern.
LikeOperator(column string, wildcardBefore bool, pattern string, wildcardAfter bool) (string, string)
Default(col *Column) string
@@ -152,10 +150,6 @@ func (b *BaseDialect) AndStr() string {
return "AND"
}
func (b *BaseDialect) LikeStr() string {
return "LIKE"
}
func (b *BaseDialect) LikeOperator(column string, wildcardBefore bool, pattern string, wildcardAfter bool) (string, string) {
param := pattern
if wildcardBefore {
@@ -31,10 +31,6 @@ func (db *PostgresDialect) Quote(name string) string {
return "\"" + name + "\""
}
func (db *PostgresDialect) LikeStr() string {
return "ILIKE"
}
func (db *PostgresDialect) LikeOperator(column string, wildcardBefore bool, pattern string, wildcardAfter bool) (string, string) {
param := pattern
if wildcardBefore {