// Oidvectorsend calls the stored procedure 'pg_catalog.oidvectorsend(oidvector) bytea' on db.
194947
func Oidvectorsend(db XODB, v0 pgtypes.Oidvector) ([]byte, error) {
	var err error

	// sql query
	const sqlstr = `SELECT pg_catalog.oidvectorsend($1)`

	// run query
	var ret []byte
	XOLog(sqlstr, v0)
	err = db.QueryRow(sqlstr, v0).Scan(&ret)
	if err != nil {
		return nil, err
	}

	return ret, nil
}
353430
func appendTableRecordPrefix(buf []byte, tableID int64) []byte {
	buf = append(buf, tablePrefix...)
	buf = codec.EncodeInt(buf, tableID)
	buf = append(buf, recordPrefixSep...)
	return buf
}
909604
func Regopersend(db XODB, v0 pgtypes.Regoper) ([]byte, error) {
	var err error

	// sql query
	const sqlstr = `SELECT pg_catalog.regopersend($1)`

	// run query
	var ret []byte
	XOLog(sqlstr, v0)
	err = db.QueryRow(sqlstr, v0).Scan(&ret)
	if err != nil {
		return nil, err
	}

	return ret, nil
}
622697
func (t *table) appendBounds() {
	bounds := []execute.Time{t.bounds.Start, t.bounds.Stop}
	for j := range []int{startColIdx, stopColIdx} {
		b := arrow.NewIntBuilder(t.alloc)
		b.Reserve(t.l)
		for i := 0; i < t.l; i++ {
			b.UnsafeAppend(int64(bounds[j]))
		}
		t.colBufs[j] = b.NewArray()
		b.Release()
	}
}
1231094
func (hc *TopNCollector) finalizeResults(r index.IndexReader) error {
	var err error
	hc.results, err = hc.store.Final(hc.skip, func(doc *search.DocumentMatch) error {
		if doc.ID == "" {
			// look up the id since we need it for lookup
			var err error
			doc.ID, err = r.ExternalID(doc.IndexInternalID)
			if err != nil {
				return err
			}
		}
		doc.Complete(nil)
		return nil
	})

	return err
}
903440
func (db *PublicRecord) GetEndosByBid(bid *wire.ShaHash) ([]*ombjson.Endorsement, error) {
	rows, err := db.selectEndosByBid.Query(bid.String())
	defer rows.Close()
	if err != nil {
		return []*ombjson.Endorsement{}, err
	}
	return scanEndos(rows)
}
904840
func EnumSend(db XODB, v0 pgtypes.Anyenum) ([]byte, error) {
	var err error

	// sql query
	const sqlstr = `SELECT pg_catalog.enum_send($1)`

	// run query
	var ret []byte
	XOLog(sqlstr, v0)
	err = db.QueryRow(sqlstr, v0).Scan(&ret)
	if err != nil {
		return nil, err
	}

	return ret, nil
}
740781
func (db *PublicRecord) GetEndorsement(txid *wire.ShaHash) (*ombjson.Endorsement, error) {
	row := db.selectEndo.QueryRow(txid.String())
	return scanEndo(row)
}
3083
func (c *Client) TermVectors(index, typ string) *TermvectorsService {
	builder := NewTermvectorsService(c)
	builder = builder.Index(index).Type(typ)
	return builder
}
1228354
func (db *CLevelDB) Iterator(start, end []byte) Iterator {
	itr := db.db.NewIterator(db.ro)
	return newCLevelDBIterator(itr, start, end, false)
}
822368
func PgShseclabelByObjoidClassoidProvider(db XODB, objoid pgtypes.Oid, classoid pgtypes.Oid, provider string) (*PgShseclabel, error) {
	var err error

	// sql query
	const sqlstr = `SELECT ` +
		`tableoid, cmax, xmax, cmin, xmin, ctid, objoid, classoid, provider, label ` +
		`FROM pg_catalog.pg_shseclabel ` +
		`WHERE objoid = $1 AND classoid = $2 AND provider = $3`

	// run query
	XOLog(sqlstr, objoid, classoid, provider)
	ps := PgShseclabel{}

	err = db.QueryRow(sqlstr, objoid, classoid, provider).Scan(&ps.Tableoid, &ps.Cmax, &ps.Xmax, &ps.Cmin, &ps.Xmin, &ps.Ctid, &ps.Objoid, &ps.Classoid, &ps.Provider, &ps.Label)
	if err != nil {
		return nil, err
	}

	return &ps, nil
}
391513
func Regconfigsend(db XODB, v0 pgtypes.Regconfig) ([]byte, error) {
	var err error

	// sql query
	const sqlstr = `SELECT pg_catalog.regconfigsend($1)`

	// run query
	var ret []byte
	XOLog(sqlstr, v0)
	err = db.QueryRow(sqlstr, v0).Scan(&ret)
	if err != nil {
		return nil, err
	}

	return ret, nil
}
642301
func GenTableRecordPrefix(tableID int64) kv.Key {
	buf := make([]byte, 0, len(tablePrefix)+8+len(recordPrefixSep))
	return appendTableRecordPrefix(buf, tableID)
}
540263
func PointSend(db XODB, v0 pgtypes.Point) ([]byte, error) {
	var err error

	// sql query
	const sqlstr = `SELECT pg_catalog.point_send($1)`

	// run query
	var ret []byte
	XOLog(sqlstr, v0)
	err = db.QueryRow(sqlstr, v0).Scan(&ret)
	if err != nil {
		return nil, err
	}

	return ret, nil
}
731897
func PgDependsByClassidObjidObjsubid(db XODB, classid pgtypes.Oid, objid pgtypes.Oid, objsubid int) ([]*PgDepend, error) {
	var err error

	// sql query
	const sqlstr = `SELECT ` +
		`tableoid, cmax, xmax, cmin, xmin, ctid, classid, objid, objsubid, refclassid, refobjid, refobjsubid, deptype ` +
		`FROM pg_catalog.pg_depend ` +
		`WHERE classid = $1 AND objid = $2 AND objsubid = $3`

	// run query
	XOLog(sqlstr, classid, objid, objsubid)
	q, err := db.Query(sqlstr, classid, objid, objsubid)
	if err != nil {
		return nil, err
	}
	defer q.Close()

	// load results
	res := []*PgDepend{}
	for q.Next() {
		pd := PgDepend{}

		// scan
		err = q.Scan(&pd.Tableoid, &pd.Cmax, &pd.Xmax, &pd.Cmin, &pd.Xmin, &pd.Ctid, &pd.Classid, &pd.Objid, &pd.Objsubid, &pd.Refclassid, &pd.Refobjid, &pd.Refobjsubid, &pd.Deptype)
		if err != nil {
			return nil, err
		}

		res = append(res, &pd)
	}

	return res, nil
}
601867
func (p *Lexer) End() bool {
	c, err := p.Byte()

	if err != nil {
		return true
	}

	if IsEndChar(c) {
		return true
	}
	p.UnreadByte()
	return false
}
892779
func (pdb *prefixDB) Iterator(start, end []byte) Iterator {
	pdb.mtx.Lock()
	defer pdb.mtx.Unlock()

	var pstart, pend []byte
	pstart = append(cp(pdb.prefix), start...)
	if end == nil {
		pend = cpIncr(pdb.prefix)
	} else {
		pend = append(cp(pdb.prefix), end...)
	}
	return newPrefixIterator(
		pdb.prefix,
		start,
		end,
		pdb.db.Iterator(
			pstart,
			pend,
		),
	)
}