Giter VIP home page Giter VIP logo

Comments (4)

Colstuwjx avatar Colstuwjx commented on July 4, 2024

Relative issue: #34 .

from gendry.

caibirdme avatar caibirdme commented on July 4, 2024

@Colstuwjx @cncal Yes, we can. The reason I didn't support _or at the begining is that, if I support _or, it's inevitable people will write codes like this:

map[string]interface{}{
  "_or": map[string]interface{}{
     "id >": 5,
     "_or": map[string]interface{}{
       "_or": map[string]interface{}{
         // ...
       }
     }
  }
}

And it'll soon become hard to understand.

But now, I think it's Okay. People know what they're doing. So, I will add the feature soon. Or if you like, it's welcome to send a pr for this

from gendry.

Colstuwjx avatar Colstuwjx commented on July 4, 2024

I agree that introducing nested _OR would make it hard to understand. Besides, We've been supported sth like this:

where := map[string]interface{}{
	"city in": []string{"beijing", "shanghai"},
	"score": 5,
	"age >": 35,
	"address": builder.IsNotNull,
	"_orderby": "bonus desc",
	"_groupby": "department",
}

if we decide to support _OR primitive, I suggest just take one layer, and suggest users take NamedQuery if the SQL is nested OR query. Otherwise, the where may grows big and hard to maintain the impl.

from gendry.

Colstuwjx avatar Colstuwjx commented on July 4, 2024

I have been proposed a draft PR #77 for this issue, Let's talk the details inside PR comments :)

from gendry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.