func (c *Connection) Update(query string, args ...interface{}) (int64, error) {
	_, affected, err := c.affectingStatement(query, args...)
	return affected, err
}
Update Run an update statement against the database.
package torm
import (
	"database/sql"
	"errors"
	"log"
	"reflect"
	"github.com/thinkoner/torm/grammar"
)
type Connection struct {
	DB          *sql.DB
	tablePrefix string
}
func (c *Connection) Table(table string) *Builder {
	return c.Query().From(table)
}
func (c *Connection) Query() *Builder {
	return NewBuilder(c, c.GetQueryGrammar())
}
func (c *Connection) SelectOne(query string, bindings []interface{}, dest interface{}) error {
	return c.Select(query, bindings, dest)
}
func (c *Connection) Select(query string, bindings []interface{}, dest interface{}) error {
	log.Println(query)
	var err error
	stmt, err := c.DB.Prepare(query)
	if err != nil {
		return err
	}
	defer stmt.Close()
	rows, err := stmt.Query(bindings...)
	if err != nil {
		return err
	}
	defer rows.Close()
	columns, err := rows.Columns()
	if err != nil {
		return err
	}
	results := reflect.Indirect(reflect.ValueOf(dest))
	kind := results.Kind()
	if kind != reflect.Slice && kind != reflect.Struct {
		return errors.New("unsupported destination, should be slice or struct")
	}
	var isPtr bool
	var resultType reflect.Type
	var resultValue reflect.Value
	resultType = results.Type()
	resultValue = results
	if kind == reflect.Slice {
		resultType = resultType.Elem()
	}
	if resultType.Kind() == reflect.Ptr {
		resultType = resultType.Elem()
		isPtr = true
	}
	if kind == reflect.Slice {
		resultValue = reflect.New(resultType).Elem()
	}
	var fields []*Field
	for i := 0; i < resultType.NumField(); i++ {
		fields = append(fields, NewField(resultValue.Field(i), resultType.Field(i)))
	}
	for rows.Next() {
		err := c.scan(rows, columns, fields)
		if err != nil {
			return err
		}
		if kind == reflect.Slice {
			if isPtr {
				resultValue = resultValue.Addr()
			}
			results.Set(reflect.Append(results, resultValue))
		} else {
			break
		}
	}
	return nil
}
func (c *Connection) Scan(query string, bindings []interface{}, dest ...interface{}) error {
	log.Println(query)
	var err error
	stmt, err := c.DB.Prepare(query)
	if err != nil {
		return err
	}
	defer stmt.Close()
	rows, err := stmt.Query(bindings...)
	if err != nil {
		return err
	}
	defer rows.Close()
	rows.Next()
	return rows.Scan(dest...)
}
func (c *Connection) Insert(query string, args ...interface{}) (int64, int64, error) {
	return c.affectingStatement(query, args...)
}