(tx *gorm.DB, column string, value string)
| 17 | ) |
| 18 | |
| 19 | func applyExplicitLogTextFilter(tx *gorm.DB, column string, value string) (*gorm.DB, error) { |
| 20 | if value == "" { |
| 21 | return tx, nil |
| 22 | } |
| 23 | if strings.Contains(value, "%") { |
| 24 | condition, pattern, err := buildLogLikeCondition(column, value) |
| 25 | if err != nil { |
| 26 | return nil, err |
| 27 | } |
| 28 | return tx.Where(condition, pattern), nil |
| 29 | } |
| 30 | return tx.Where(column+" = ?", value), nil |
| 31 | } |
| 32 | |
| 33 | func buildLogLikeCondition(column string, value string) (string, string, error) { |
| 34 | if common.UsingLogDatabase(common.DatabaseTypeClickHouse) { |
no test coverage detected