Skip to content

And() & Or() override inner Cond elements relationship #280

@c2h5oh

Description

@c2h5oh
cond1 := db.Cond{"col1": "val1", "col2": "val2"}
cond2 := db.Cond{"col3": "val3"}

q.Where(db.Or(cond1, cond2))

expected:
WHERE (col1 = val1 AND col2 = val2) OR (col3 = val3)

actual
WHERE ((col1 = val1 AND col2 = val2 OR col3 = val3))

The same happens with And

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions