(cfg *SQLGenerator)
| 44 | func (equality) UseAs() Node { return AstBoolean{} } |
| 45 | |
| 46 | func (e equality) SQLString(cfg *SQLGenerator) string { |
| 47 | // Equalities can be flipped without changing the result, so we can |
| 48 | // try both left = right and right = left. |
| 49 | if eq, ok := e.Left.(SupportsEquality); ok { |
| 50 | v, err := eq.EqualsSQLString(cfg, e.Not, e.Right) |
| 51 | if err == nil { |
| 52 | return v |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | if eq, ok := e.Right.(SupportsEquality); ok { |
| 57 | v, err := eq.EqualsSQLString(cfg, e.Not, e.Left) |
| 58 | if err == nil { |
| 59 | return v |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | cfg.AddError(xerrors.Errorf("unsupported equality: %T %s %T", e.Left, equalsOp(e.Not), e.Right)) |
| 64 | return "EqualityError" |
| 65 | } |
| 66 | |
| 67 | func (e equality) EqualsSQLString(cfg *SQLGenerator, not bool, other Node) (string, error) { |
| 68 | return boolEqualsSQLString(cfg, e, not, other) |
nothing calls this directly
no test coverage detected