MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / containsAny

Function containsAny

pkg/sql/parser/dialect_test.go:438–446  ·  view source on GitHub ↗

--------------------------------------------------------------------------- helpers --------------------------------------------------------------------------- containsAny reports whether s contains any of the given substrings using a case-insensitive comparison. Both s and each element of substrs

(s string, substrs ...string)

Source from the content-addressed store, hash-verified

436// containsAny("LIMIT clause not supported", "limit", "SQL Server") // true
437// containsAny("unknown dialect", "TOP", "FETCH") // false
438func containsAny(s string, substrs ...string) bool {
439 lower := strings.ToLower(s)
440 for _, sub := range substrs {
441 if strings.Contains(lower, strings.ToLower(sub)) {
442 return true
443 }
444 }
445 return false
446}

Callers 9

TestRejectUnknownDialectFunction · 0.85
TestRejectTopInMySQLFunction · 0.85
TestRejectTopInSQLiteFunction · 0.85
TestRejectTopInOracleFunction · 0.85
TestRejectLimitInOracleFunction · 0.85
TestRejectILIKEInMySQLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected