func (adapter *Adapter) Update(query grimoire.Query, changes map[string]interface{}, loggers ...grimoire.Logger) error {
	statement, args := NewBuilder(adapter.Config).Update(query.Collection, changes, query.Condition)
	_, _, err := adapter.Exec(statement, args, loggers...)
	return err
}
Update updates a record in database.
package sql
import (
	"database/sql"
	"strconv"
	"time"
	"github.com/Fs02/grimoire"
	"github.com/Fs02/grimoire/errors"
)
type Config struct {
	Placeholder         string
	Ordinal             bool
	InsertDefaultValues bool
	EscapeChar          string
	ErrorFunc           func(error) error
	IncrementFunc       func(Adapter) int
}
type Adapter struct {
	Config    *Config
	DB        *sql.DB
	Tx        *sql.Tx
	savepoint int
}
var _ grimoire.Adapter = (*Adapter)(nil)
func (adapter *Adapter) Close() error {
	return adapter.DB.Close()
}
func (adapter *Adapter) All(query grimoire.Query, doc interface{}, loggers ...grimoire.Logger) (int, error) {
	statement, args := NewBuilder(adapter.Config).Find(query)
	count, err := adapter.Query(doc, statement, args, loggers...)
	return int(count), err
}
func (adapter *Adapter) Aggregate(query grimoire.Query, doc interface{}, loggers ...grimoire.Logger) error {
	statement, args := NewBuilder(adapter.Config).Aggregate(query)
	_, err := adapter.Query(doc, statement, args, loggers...)
	return err
}
func (adapter *Adapter) Insert(query grimoire.Query, changes map[string]interface{}, loggers ...grimoire.Logger) (interface{}, error) {
	statement, args := NewBuilder(adapter.Config).Insert(query.Collection, changes)
	id, _, err := adapter.Exec(statement, args, loggers...)
	return id, err
}
func (adapter *Adapter) InsertAll(query grimoire.Query, fields []string, allchanges []map[string]interface{}, loggers ...grimoire.Logger) ([]interface{}, error) {
	statement, args := NewBuilder(adapter.Config).InsertAll(query.Collection, fields, allchanges)
	id, _, err := adapter.Exec(statement, args, loggers...)
	if err != nil {
		return nil, err
	}
	var (
		ids = []interface{}{id}
		inc = 1
	)
	if adapter.Config.IncrementFunc != nil {
		inc = adapter.Config.IncrementFunc(*adapter)
	}
	for i := 1; i < len(allchanges); i++ {
		ids = append(ids, id+int64(inc*i))
	}
	return ids, nil
}