Skip to content
This repository has been archived by the owner on Jun 14, 2019. It is now read-only.

how to use builder with xorm #9

Closed
dwdcth opened this issue Jan 18, 2018 · 3 comments · Fixed by go-xorm/xorm#829
Closed

how to use builder with xorm #9

dwdcth opened this issue Jan 18, 2018 · 3 comments · Fixed by go-xorm/xorm#829

Comments

@dwdcth
Copy link

dwdcth commented Jan 18, 2018

I try this code,

sql, args, _ := builder.Select("*").
		From("user").
		Where(builder.Eq{"uid": 1}).
		ToSQL()
res, err := orm.QueryInterface(sql, args)

but it goes wrong ,"sql: converting argument $1 type: unsupported type []interface {}, a slice of interface"

@lunny
Copy link
Member

lunny commented Jan 18, 2018

res, err := orm.QueryInterface(sql, args...)

args is a slice of interface

@lunny lunny added the question label Jan 18, 2018
@dwdcth
Copy link
Author

dwdcth commented Jan 18, 2018

This is wrong too,in golang 1.9.2.

too many arguments in call to orm.QueryInterface
have (string, []interface {}...)
want (...interface {})

@lunny
Copy link
Member

lunny commented Jan 18, 2018

see test functions on go-xorm/xorm#829 to know how to use that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants