package queries

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

type ORMResults struct {
	model        orm.Model
	rowsAffected int
	rowsReturned int
}

func (r *ORMResults) Model() orm.Model {
	return r.model
}

func (r *ORMResults) RowsAffected() int {
	return r.rowsAffected
}

func (r *ORMResults) RowsReturned() int {
	return r.rowsReturned
}

func (r *ORMResults) SetModel(model orm.Model) {
	r.model = model
}

func (r *ORMResults) AddResult(result orm.Result) {
	r.rowsAffected += result.RowsAffected()
	r.rowsReturned += result.RowsReturned()
}
