package db

import (
	"context"

	"github.com/go-pg/pg/v10/orm"
)

type Operation interface {
	Close() error
	Context() context.Context
	Exec(query interface{}, params ...interface{}) (orm.Result, error)
	ExecContext(c context.Context, query interface{}, params ...interface{}) (orm.Result, error)
	ExecOne(query interface{}, params ...interface{}) (orm.Result, error)
	ExecOneContext(c context.Context, query interface{}, params ...interface{}) (orm.Result, error)
	Formatter() orm.QueryFormatter
	Model(model ...interface{}) *orm.Query
	ModelContext(c context.Context, model ...interface{}) *orm.Query
	Query(model interface{}, query interface{}, params ...interface{}) (orm.Result, error)
	QueryContext(c context.Context, model interface{}, query interface{}, params ...interface{}) (orm.Result, error)
	QueryOne(model interface{}, query interface{}, params ...interface{}) (orm.Result, error)
	QueryOneContext(c context.Context, model interface{}, query interface{}, params ...interface{}) (orm.Result, error)
}
