// PgLargeobjectByLoidPageno retrieves a row from 'pg_catalog.pg_largeobject' as a PgLargeobject.
//
// Generated from index 'pg_largeobject_loid_pn_index'.
420948
func PgLargeobjectByLoidPageno(db XODB, loid pgtypes.Oid, pageno int) (*PgLargeobject, error) {
	var err error

	// sql query
	const sqlstr = `SELECT ` +
		`tableoid, cmax, xmax, cmin, xmin, ctid, loid, pageno, data ` +
		`FROM pg_catalog.pg_largeobject ` +
		`WHERE loid = $1 AND pageno = $2`

	// run query
	XOLog(sqlstr, loid, pageno)
	pl := PgLargeobject{}

	err = db.QueryRow(sqlstr, loid, pageno).Scan(&pl.Tableoid, &pl.Cmax, &pl.Xmax, &pl.Cmin, &pl.Xmin, &pl.Ctid, &pl.Loid, &pl.Pageno, &pl.Data)
	if err != nil {
		return nil, err
	}

	return &pl, nil
}
345881
func (s *S3Settings) SetDictPageSizeLimit(v int64) *S3Settings {
	s.DictPageSizeLimit = &v
	return s
}
405959
func (l *b2Objects) GetObjectNInfo(ctx context.Context, bucket, object string, rs *minio.HTTPRangeSpec, h http.Header, lockType minio.LockType, opts minio.ObjectOptions) (gr *minio.GetObjectReader, err error) {
	var objInfo minio.ObjectInfo
	objInfo, err = l.GetObjectInfo(ctx, bucket, object, opts)
	if err != nil {
		return nil, err
	}

	var startOffset, length int64
	startOffset, length, err = rs.GetOffsetLength(objInfo.Size)
	if err != nil {
		return nil, err
	}

	pr, pw := io.Pipe()
	go func() {
		err := l.GetObject(ctx, bucket, object, startOffset, length, pw, objInfo.ETag, opts)
		pw.CloseWithError(err)
	}()
	// Setup cleanup function to cause the above go-routine to
	// exit in case of partial read
	pipeCloser := func() { pr.Close() }
	return minio.NewGetObjectReaderFromReader(pr, objInfo, opts.CheckCopyPrecondFn, pipeCloser)
}
369499
func PgTransformByOid(db XODB, oid pgtypes.Oid) (*PgTransform, error) {
	var err error

	// sql query
	const sqlstr = `SELECT ` +
		`tableoid, cmax, xmax, cmin, xmin, oid, ctid, trftype, trflang, trffromsql, trftosql ` +
		`FROM pg_catalog.pg_transform ` +
		`WHERE oid = $1`

	// run query
	XOLog(sqlstr, oid)
	pt := PgTransform{}

	err = db.QueryRow(sqlstr, oid).Scan(&pt.Tableoid, &pt.Cmax, &pt.Xmax, &pt.Cmin, &pt.Xmin, &pt.Oid, &pt.Ctid, &pt.Trftype, &pt.Trflang, &pt.Trffromsql, &pt.Trftosql)
	if err != nil {
		return nil, err
	}

	return &pt, nil
}
527900
func (obj *GenericObject) GetListObjectData(ctx context.Context, path string, pages []*NxPage) ([]*NxDataPage, error) {
	result := &struct {
		DataPages []*NxDataPage	`json:"qDataPages"`
	} {}
	err := obj.rpc(ctx, "GetListObjectData", result, path, pages)
	return result.DataPages, err 
}
741406
func (d *Document) AddObject(object *Object) *Error {

	if d.Mode == ErrorMode {
		return ISE("Cannot add data to a document already possessing errors")
	}

	if d.Mode == ObjectMode && len(d.Data) == 1 {
		return ISE("Single 'data' object response is expected, you are attempting to add more than one element to be returned")
	}

	// if not yet set, add the associated HTTP status with the object
	if d.Status == 0 {
		d.Status = object.Status
	}

	// finally, actually add the object to data List
	if d.Data == nil {
		d.Data = List{object}
	} else {
		d.Data = append(d.Data, object)
	}

	return nil
}
973278
func PagingPage(p Page, totalRecords int, items interface{}) Page {
	return Paging(p.Page, p.Size, totalRecords, items)
}
401542
func (in *NodeProxyOptions) DeepCopyObject() runtime.Object {
	if c := in.DeepCopy(); c != nil {
		return c
	}
	return nil
}
578039
func PgCollationByOid(db XODB, oid pgtypes.Oid) (*PgCollation, error) {
	var err error

	// sql query
	const sqlstr = `SELECT ` +
		`tableoid, cmax, xmax, cmin, xmin, oid, ctid, collname, collnamespace, collowner, collencoding, collcollate, collctype ` +
		`FROM pg_catalog.pg_collation ` +
		`WHERE oid = $1`

	// run query
	XOLog(sqlstr, oid)
	pc := PgCollation{}

	err = db.QueryRow(sqlstr, oid).Scan(&pc.Tableoid, &pc.Cmax, &pc.Xmax, &pc.Cmin, &pc.Xmin, &pc.Oid, &pc.Ctid, &pc.Collname, &pc.Collnamespace, &pc.Collowner, &pc.Collencoding, &pc.Collcollate, &pc.Collctype)
	if err != nil {
		return nil, err
	}

	return &pc, nil
}
71017
func (d *domainClient) GetObjectByHeapObjectID(ctx context.Context, args *GetObjectByHeapObjectIDArgs) (reply *GetObjectByHeapObjectIDReply, err error) {
	reply = new(GetObjectByHeapObjectIDReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "HeapProfiler.getObjectByHeapObjectId", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "HeapProfiler.getObjectByHeapObjectId", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "HeapProfiler", Op: "GetObjectByHeapObjectID", Err: err}
	}
	return
}
379602
func (h *handler) fetchDocumentByPages(pages []blob.Ref) (*document, error) {
	return h.fetchDocumentFunc(pages, h.searchDocumentByPages)
}
195895
func (xl xlObjects) GetObjectNInfo(ctx context.Context, bucket, object string, rs *HTTPRangeSpec, h http.Header, lockType LockType, opts ObjectOptions) (gr *GetObjectReader, err error) {
	var nsUnlocker = func() {}

	// Acquire lock
	if lockType != noLock {
		lock := xl.nsMutex.NewNSLock(bucket, object)
		switch lockType {
		case writeLock:
			if err = lock.GetLock(globalObjectTimeout); err != nil {
				return nil, err
			}
			nsUnlocker = lock.Unlock
		case readLock:
			if err = lock.GetRLock(globalObjectTimeout); err != nil {
				return nil, err
			}
			nsUnlocker = lock.RUnlock
		}
	}

	if err = checkGetObjArgs(ctx, bucket, object); err != nil {
		nsUnlocker()
		return nil, err
	}

	// Handler directory request by returning a reader that
	// returns no bytes.
	if hasSuffix(object, slashSeparator) {
		var objInfo ObjectInfo
		if objInfo, err = xl.getObjectInfoDir(ctx, bucket, object); err != nil {
			nsUnlocker()
			return nil, toObjectErr(err, bucket, object)
		}
		return NewGetObjectReaderFromReader(bytes.NewBuffer(nil), objInfo, opts.CheckCopyPrecondFn, nsUnlocker)
	}

	var objInfo ObjectInfo
	objInfo, err = xl.getObjectInfo(ctx, bucket, object)
	if err != nil {
		nsUnlocker()
		return nil, toObjectErr(err, bucket, object)
	}

	fn, off, length, nErr := NewGetObjectReader(rs, objInfo, opts.CheckCopyPrecondFn, nsUnlocker)
	if nErr != nil {
		return nil, nErr
	}

	pr, pw := io.Pipe()
	go func() {
		err := xl.getObject(ctx, bucket, object, off, length, pw, "", opts)
		pw.CloseWithError(err)
	}()
	// Cleanup function to cause the go routine above to exit, in
	// case of incomplete read.
	pipeCloser := func() { pr.Close() }

	return fn(pr, h, opts.CheckCopyPrecondFn, pipeCloser)
}
896531
func NewObjectPageIterator(ctx context.Context, s Store, q Query) ObjectIterator {

	cancelCtx, cancel := context.WithCancel(ctx)
	return &ObjectPageIterator{
		s:      s,
		ctx:    cancelCtx,
		cancel: cancel,
		q:      q,
	}
}
718265
func (in *IngressRoute) DeepCopyObject() runtime.Object {
	if c := in.DeepCopy(); c != nil {
		return c
	}
	return nil
}
741085
func PgReplicationOriginByRoident(db XODB, roident pgtypes.Oid) (*PgReplicationOrigin, error) {
	var err error

	// sql query
	const sqlstr = `SELECT ` +
		`tableoid, cmax, xmax, cmin, xmin, ctid, roident, roname ` +
		`FROM pg_catalog.pg_replication_origin ` +
		`WHERE roident = $1`

	// run query
	XOLog(sqlstr, roident)
	pro := PgReplicationOrigin{}

	err = db.QueryRow(sqlstr, roident).Scan(&pro.Tableoid, &pro.Cmax, &pro.Xmax, &pro.Cmin, &pro.Xmin, &pro.Ctid, &pro.Roident, &pro.Roname)
	if err != nil {
		return nil, err
	}

	return &pro, nil
}
1121585
func (b *Bucket) pageNode(id pgid) (*page, *node) {
	// Inline buckets have a fake page embedded in their value so treat them
	// differently. We'll return the rootNode (if available) or the fake page.
	if b.root == 0 {
		if id != 0 {
			panic(fmt.Sprintf("inline bucket non-zero page access(2): %d != 0", id))
		}
		if b.rootNode != nil {
			return nil, b.rootNode
		}
		return b.page, nil
	}

	// Check the node cache for non-inline buckets.
	if b.nodes != nil {
		if n := b.nodes[id]; n != nil {
			return nil, n
		}
	}

	// Finally lookup the page from the transaction if no node is materialized.
	return b.tx.page(id), nil
}
1105123
func (db *DB) page(id pgid) *page {
	pos := id * pgid(db.pageSize)
	return (*page)(unsafe.Pointer(&db.data[pos]))
}