uptrace / bun

SQL-first Golang ORM
https://bun.uptrace.dev
BSD 2-Clause "Simplified" License
3.83k stars 230 forks source link

A simpler way to add logic for filtering with logical operators #552

Open frederikhors opened 2 years ago

frederikhors commented 2 years ago

I'm using GraphQL in Golang with gqlgen and Bun as ORM.

I'm using DDD and Clean architecture, meaning that I'm avoiding one-size-fits-all/lock-in solutions like Hasura, Postgraphile, DGraph and everything like that; I can (and I eventually will, no hurry) write and organize my code in such a way to achieve their features.

For now I'm wondering about complex queries with filters like: AND, OR, NOT (better described here).

Right now I need to think/write/test code all by myself and this certainly does not speed up production of the software I want to write.

Also, my code will almost certainly be slow, buggy and possibly all wrong as soon as I realize that I will need something extra for this feature.

After all, this is true for all software and is one of the reasons why open source was born.

After some research I noticed there are two approaches to solving the problem of GraphQL data filtering:

QUESTIONs

  1. What do you think if in Bun we already offer some facilities to avoid manually writing the code for this problem using .WhereGroup(), .Where() and .WhereOr()?
  2. Or at least we can update the docs with simple but also complex examples
github-actions[bot] commented 2 weeks ago

This issue has been automatically marked as stale because it has not had activity in the last 30 days. If there is no update within the next 7 days, this issue will be closed.