示例#1
0
func ExampleContext_Where() {
	type Person struct {
		// ...
	}

	ctx := rebecca.Context{Order: "age DESC"}
	teenagers := []Person{}
	if err := ctx.Where(&teenagers, "age < $1", 21); err != nil {
		panic(err)
	}
	// At this point teenagers will contain a list of Person records sorted by
	// age in descending order and where age < 21.
	fmt.Print(teenagers)
}