canonical / sqlair

Friendly type mapping for SQL databases
Apache License 2.0
17 stars 8 forks source link

Add RunQuery #62

Closed Aflynn50 closed 1 year ago

Aflynn50 commented 1 year ago

This PR adds a method to DB called RunQuery. This method is shorthand for

stmt, err := Prepare(query, args...)
if err != nil {
    ...
}
err := db.Query(ctx, stmt, args...).Run()

For example instead of the above, you would write:

err := db.RunQuery(ctx, query, args...)

This PR is waiting on #63