// GinCmpPrefix calls the stored procedure 'pg_catalog.gin_cmp_prefix(text, text, smallint, internal) integer' on db.
970018
func GinCmpPrefix(db XODB, v0 string, v1 string, v2 int16, v3 pgtypes.Internal) (int, error) {
	var err error

	// sql query
	const sqlstr = `SELECT pg_catalog.gin_cmp_prefix($1, $2, $3, $4)`

	// run query
	var ret int
	XOLog(sqlstr, v0, v1, v2, v3)
	err = db.QueryRow(sqlstr, v0, v1, v2, v3).Scan(&ret)
	if err != nil {
		return 0, err
	}

	return ret, nil
}
135355
func (pb *Bar) Prefix(prefix string) *Bar {
	pb.mu.Lock()
	defer pb.mu.Unlock()

	pb.prefix = prefix
	return pb
}
661485
func (a *Array) IPPrefix(pfx net.IPNet) *Array {
	a.buf = enc.AppendIPPrefix(enc.AppendArrayDelim(a.buf), pfx)
	return a
}
1262096
func (c *Client) blobPrefix() (string, error) {
	pfx, err := c.prefix()
	if err != nil {
		return "", err
	}
	if !c.isSharePrefix {
		pfx += "/camli"
	}
	return pfx, nil
}
1374202
func (t *Tombstoner) AddPrefix(key []byte) error {
	return t.AddPrefixRange(key, math.MinInt64, math.MaxInt64)
}
250877
func Ginrescan(db XODB, v0 pgtypes.Internal, v1 pgtypes.Internal, v2 pgtypes.Internal, v3 pgtypes.Internal, v4 pgtypes.Internal) error {
	var err error

	// sql query
	const sqlstr = `SELECT pg_catalog.ginrescan($1, $2, $3, $4, $5)`

	// run query
	XOLog(sqlstr)
	_, err = db.Exec(sqlstr)
	return err
}
1270886
func NewTrimPrefixProcessor(prefix string) ProcessorFunc {
	prefixTrimmer := func(in string) (string, bool) {
		out := strings.TrimPrefix(in, prefix)
		return out, out != in
	}
	return NewLoopProcessor(ProcessorFunc(prefixTrimmer))
}
548971
func (m *Mux) Prefix(p string) *Mux {
	m.prefix = strings.TrimSuffix(p, "/")
	return m
}
1058543
func GenTablePrefix(tableID int64) kv.Key {
	buf := make([]byte, 0, len(tablePrefix)+8)
	buf = append(buf, tablePrefix...)
	buf = codec.EncodeInt(buf, tableID)
	return buf
}
824772
func (s *UpdateCrawlerInput) SetTablePrefix(v string) *UpdateCrawlerInput {
	s.TablePrefix = &v
	return s
}
555644
func WithPrefix(prefix string) option {
	return func(m *Module) {
		m.prefix = strings.ToLower(prefix)
	}
}
1357799
func ParsePrefix(raw string) (p *Prefix) {

	p = new(Prefix)

	user := indexByte(raw, prefixUser)
	host := indexByte(raw, prefixHost)

	switch {

	case user > 0 && host > user:
		p.Name = raw[:user]
		p.User = raw[user+1 : host]
		p.Host = raw[host+1:]

	case user > 0:
		p.Name = raw[:user]
		p.User = raw[user+1:]

	case host > 0:
		p.Name = raw[:host]
		p.Host = raw[host+1:]

	default:
		p.Name = raw

	}

	return p
}
728632
func (e Encoder) AppendIPPrefix(dst []byte, pfx net.IPNet) []byte {
	dst = append(dst, byte(majorTypeTags|additionalTypeIntUint16))
	dst = append(dst, byte(additionalTypeTagNetworkPrefix>>8))
	dst = append(dst, byte(additionalTypeTagNetworkPrefix&0xff))

	// Prefix is a tuple (aka MAP of 1 pair of elements) -
	// first element is prefix, second is mask length.
	dst = append(dst, byte(majorTypeMap|0x1))
	dst = e.AppendBytes(dst, pfx.IP)
	maskLen, _ := pfx.Mask.Size()
	return e.AppendUint8(dst, uint8(maskLen))
}
1291533
func (s *CreateCrawlerInput) SetTablePrefix(v string) *CreateCrawlerInput {
	s.TablePrefix = &v
	return s
}
398252
func instPrefix(b byte, mode int) (Inst, error) {
	// When tracing it is useful to see what called instPrefix to report an error.
	if trace {
		_, file, line, _ := runtime.Caller(1)
		fmt.Printf("%s:%d\n", file, line)
	}
	p := Prefix(b)
	switch p {
	case PrefixDataSize:
		if mode == 16 {
			p = PrefixData32
		} else {
			p = PrefixData16
		}
	case PrefixAddrSize:
		if mode == 32 {
			p = PrefixAddr16
		} else {
			p = PrefixAddr32
		}
	}
	// Note: using composite literal with Prefix key confuses 'bundle' tool.
	inst := Inst{Len: 1}
	inst.Prefix = Prefixes{p}
	return inst, nil
}
594127
func (r *Render) getCurrentPrefix() string {
	if prefix, ok := r.livePrefixCallback(); ok {
		return prefix
	}
	return r.prefix
}
28905
func Gt(column string) Cmp {
	return Cmp{
		op:     gt,
		column: column,
		value:  param(column),
	}
}