Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Added method QueryBuilder().remove_where(column) #311

Open
wants to merge 2 commits into
base: 0.9
Choose a base branch
from

Conversation

ar45
Copy link

@ar45 ar45 commented May 31, 2019

Sometimes we need to dynamically remove a where clause referencing a particular column
and somtimes, only when the clause involves a particular operator.

Can be used as

Remove all clasues referencing column_a

query.remove_where('column_a')

Remove all clasues referencing column_a with operator !=

query.remove_where('column_a', '!=')

Store the bindings for each where on the where dict within self.wheres
so that we can easily remove the clause and it's bindings.

ar45 added 2 commits May 30, 2019 23:13
Sometimes we need to dynamically remove a where clause referencing a particular column
and somtimes, only when the clause involves a particular operator.

Can be used as

Remove all clasues referencing column_a
```python3
query.remove_where('column_a')
```

Remove all clasues referencing column_a with operator `!=`
```python3
query.remove_where('column_a', '!=')
```

Store the bindings for each `where` on the where dict within self.wheres
so that we can easily remove the clause and it's bindings.
@ar45 ar45 force-pushed the allow_removing_where branch from 79ead25 to cf33046 Compare June 17, 2019 15:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant