func PrimaryKey(exec gomodel.Executor) string { return exec.Driver().PrimaryKey() }
func QueryOneResultById(exec gomodel.Executor, sqlid uint64, ptr interface{}, args ...interface{}) error { sc := exec.QueryById(sqlid, args...) defer sc.Close() return sc.One(ptr) }
func DuplicatePrimaryKeyError(exec gomodel.Executor, err error, newErr error) error { pk := exec.Driver().PrimaryKey() return parseKeyError(err, pk, newErr, exec.Driver().DuplicateKey) }
func ForeignKeyError(exec gomodel.Executor, err error, key string, newErr error) error { fk := exec.Driver().ForeignKey return parseKeyError(err, key, newErr, fk) }
func ForeignKeyFunc(exec gomodel.Executor, err error, keyfunc func(key string) error) error { fk := exec.Driver().ForeignKey return parseKeyFunc(err, keyfunc, fk) }
func DuplicateKeyError(exec gomodel.Executor, err error, key string, newErr error) error { dk := exec.Driver().DuplicateKey return parseKeyError(err, key, newErr, dk) }
func DuplicateKeyFunc(exec gomodel.Executor, err error, keyfunc func(key string) error) error { dk := exec.Driver().DuplicateKey return parseKeyFunc(err, keyfunc, dk) }