func NewBaseQuery(schema Schema) *BaseQuery {
	return &BaseQuery{
		builder: squirrel.StatementBuilder.
			PlaceholderFormat(squirrel.Dollar).
			Select().
			From(schema.Table() + " " + schema.Alias()),
		columns:   columnSet(schema.Columns()),
		batchSize: 50,
		schema:    schema,
	}
}
NewBaseQuery creates a new BaseQuery for querying the table of the given schema.
package kallax
import (
	"errors"
	"fmt"
	"github.com/Masterminds/squirrel"
)
var (
	ErrManyToManyNotSupported = errors.New("kallax: many to many relationships are not supported")
)
type Query interface {
	compile() ([]string, squirrel.SelectBuilder)
	getRelationships() []Relationship
	isReadOnly() bool
	Schema() Schema
	GetOffset() uint64
	GetLimit() uint64
	GetBatchSize() uint64
}
type columnSet []SchemaField
func (cs columnSet) contains(col SchemaField) bool {
	for _, c := range cs {
		if c.String() == col.String() {
			return true
		}
	}
	return false
}
func (cs *columnSet) add(cols ...SchemaField) {
	for _, col := range cols {
		cs.addCol(col)
	}
}
func (cs *columnSet) addCol(col SchemaField) {
	if !cs.contains(col) {
		*cs = append(*cs, col)
	}
}
func (cs *columnSet) remove(cols ...SchemaField) {
	var newSet = make(columnSet, 0, len(*cs))
	toRemove := columnSet(cols)
	for _, col := range *cs {
		if !toRemove.contains(col) {
			newSet = append(newSet, col)
		}
	}
	*cs = newSet
}
func (cs columnSet) copy() []SchemaField {
	var result = make(columnSet, len(cs))
	for i, col := range cs {
		result[i] = col
	}
	return result
}
type BaseQuery struct {
	schema          Schema
	columns         columnSet
	excludedColumns columnSet
	relationColumns []string
	relationships   []Relationship
	builder         squirrel.SelectBuilder
	selectChanged bool
	batchSize     uint64
	offset        uint64
	limit         uint64
}