Giter VIP home page Giter VIP logo

Comments (7)

caibirdme avatar caibirdme commented on July 24, 2024

I'll support that feature as soon as possible

from gendry.

jingyugao avatar jingyugao commented on July 24, 2024

I'll support that feature as soon as possible

By the way, can gendry support different value on same key?
for example, i have a condition "I_ID in (1,2,3) and I_ID in (2,3,4) and I_ID not in (3,4)".
This sql seems stupid, however, it really happened.
NamedQuery works well in this case, but i prefer BuildSelect.

from gendry.

caibirdme avatar caibirdme commented on July 24, 2024

I suggest that you could write a function merge(arrA, arrB []int) []int to merge the array

from gendry.

caibirdme avatar caibirdme commented on July 24, 2024

@jingyugao I found that not in is already supported... Did you try that? Or just because you didn't find related document on README?

This is a unit test for Not In

func Test_NotIn(t *testing.T) {
	where := map[string]interface{}{
		"city in":            []string{"beijing", "shanghai"},
		"age >":              35,
		"address":            IsNotNull,
		" hobbies not in   ": []string{"baseball", "swim", "running"},
		"_groupby":           "department",
		"_orderby":           "bonus desc",
	}
	table := "some_table"
	selectFields := []string{"name", "age", "sex"}
	cond, _, err := BuildSelect(table, where, selectFields)
	ass := assert.New(t)
	ass.NoError(err)
	expect := `SELECT name,age,sex FROM some_table WHERE (city IN (?,?) AND hobbies NOT IN (?,?,?) AND age>? AND address IS NOT NULL) GROUP BY department ORDER BY bonus DESC`
	ass.Equal(expect, cond)
}

from gendry.

jingyugao avatar jingyugao commented on July 24, 2024

maybe my version is too old.
It's [email protected]

from gendry.

jingyugao avatar jingyugao commented on July 24, 2024

Thanks,after updating,it works.

from gendry.

caibirdme avatar caibirdme commented on July 24, 2024

Use v1.0.x

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.