Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use split chaining #1

Open
lelvisl opened this issue Nov 14, 2018 · 0 comments
Open

Can't use split chaining #1

lelvisl opened this issue Nov 14, 2018 · 0 comments

Comments

@lelvisl
Copy link

lelvisl commented Nov 14, 2018

package main

import (
	"fmt"
	nqb "github.com/wheniwork/n1ql-query-builder"
)

func main() {
	bucket := "dicts"
	dictKey := "_dict"
	name := "lalka"
	limit := 15
	offset := 10
	where := nqb.X(dictKey).Eq(nqb.S(name))

	s := nqb.Select(nqb.Meta("id")).From(bucket)

	s.Where(where)
	if limit > 0 {
		s.Limit(limit)

	}
	if offset > 0 {
		s.Offset(10)
	}

	fmt.Println(s.String())
}
$ go run main.go
SELECT META(id) FROM dicts OFFSET 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant