Make Get and Rows.Scan accept multiple parameters #2029

Merged
lunny merged 2 commits from lunny/get_vars into master 12 months ago
lunny commented 1 year ago
Owner

Now the below behaviours are allowed.

var id int64
var name string
has, err := engine.Table(&user).Cols("id", "name").Get(&id, &name)
// SELECT id, name FROM user LIMIT 1
rows, err := engine.Cols("name", "age").Rows(&User{Name:name})
// SELECT * FROM user
defer rows.Close()
for rows.Next() {
    var name string
    var age int
    err = rows.Scan(&name, &age)
}
Now the below behaviours are allowed. ```Go var id int64 var name string has, err := engine.Table(&user).Cols("id", "name").Get(&id, &name) // SELECT id, name FROM user LIMIT 1 ``` ```Go rows, err := engine.Cols("name", "age").Rows(&User{Name:name}) // SELECT * FROM user defer rows.Close() for rows.Next() { var name string var age int err = rows.Scan(&name, &age) } ```
lunny added this to the 1.3.0 milestone 1 year ago
lunny added the
kind/breaking
label 1 year ago
lunny added 1 commit 1 year ago
continuous-integration/drone/pr Build is failing Details
8526ca3740
Make Get and Rows.Scan accept multiple parameters
lunny force-pushed lunny/get_vars from 8526ca3740 to 21a5fce26b 1 year ago
lunny added the
kind/feature
label 1 year ago
lunny force-pushed lunny/get_vars from 21a5fce26b to ade9e26c40 12 months ago
lunny merged commit d92fb412ee into master 12 months ago
lunny deleted branch lunny/get_vars 12 months ago
continuous-integration/drone/pr Build is passing
The pull request has been merged as d92fb412ee.
Sign in to join this conversation.
Loading…
There is no content yet.