We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
import "github.com/mgutz/dat.v1" builder := dat.Select("*").From("posts").Where("user_id = $1", 1) // Get builder's SQL and arguments sql, args := builder.ToSQL() fmt.Println(sql) // SELECT * FROM posts WHERE (user_id = $1) fmt.Println(args) // [1] // Use raw database/sql for actual query rows, err := db.Query(sql, args...) // Alternatively build the interpolated sql statement sql, args, err := builder.Interpolate() if len(args) == 0 { rows, err = db.Query(sql) } else { rows, err = db.Query(sql, args...) }