// TimestampNamed adds a USING TIMESTAMP clause to the query with a custom
// parameter name.
329179
func (b *BatchBuilder) TimestampNamed(name string) *BatchBuilder {
	b.using.TimestampNamed(name)
	return b
}
32291
func WithNamespacedUniqueTimestampQuery(queryDoc bson.M, timestamps []bson.MongoTimestamp, prefixes []string) bson.M {
	newQueryDoc := queryDoc
	for idx, prefix := range prefixes {
		newQueryDoc[prefix+UniqueTimestampKey] = timestamps[idx]
	}
	return newQueryDoc
}
1289040
func (f *FieldCache) FieldNamed(field string, createIfMissing bool) (uint16, bool) {
	f.mutex.RLock()
	if index, ok := f.fieldIndexes[field]; ok {
		f.mutex.RUnlock()
		return index, true
	} else if !createIfMissing {
		f.mutex.RUnlock()
		return 0, false
	}
	// trade read lock for write lock
	f.mutex.RUnlock()
	f.mutex.Lock()
	// need to check again with write lock
	if index, ok := f.fieldIndexes[field]; ok {
		f.mutex.Unlock()
		return index, true
	}
	// assign next field id
	index := f.addLOCKED(field, uint16(f.lastFieldIndex+1))
	f.mutex.Unlock()
	return index, false
}
103013
func (c *ChatDeleteCall) Timestamp(timestamp string) *ChatDeleteCall {
	c.timestamp = timestamp
	return c
}
983697
func (b *UpdateBuilder) Timestamp(t time.Time) *UpdateBuilder {
	b.using.Timestamp(t)
	return b
}
189472
func (db *DB) PrepareNamed(query string) (*NamedStmt, error) {
	return prepareNamed(db, query)
}
636573
func (c *ChannelsHistoryCall) Timestamp(timestamp string) *ChannelsHistoryCall {
	c.timestamp = timestamp
	return c
}
326618
func TimestampParse(s string) (Timestamp, error) {
	layout := "2006-01-02T15:04:05.999Z"
	t, e := time.Parse(layout, s)
	if e != nil {
		if strings.HasSuffix(s, "+00:00") || strings.HasSuffix(s, "-00:00") {
			t, e = time.Parse(layout, s[:len(s)-6]+"Z")
		} else if strings.HasSuffix(s, "+0000") || strings.HasSuffix(s, "-0000") {
			t, e = time.Parse(layout, s[:len(s)-5]+"Z")
		}
		if e != nil {
			var ts Timestamp
			return ts, e
		}
	}
	return Timestamp{t}, nil
}
48518
func (ev *EventObject) Timestamp() int {
	ms := ev.Get("timeStamp").Int()
	s := ms / 1000
	// ns := (ms % 1000 * 1e6)
	// return time.Unix(int64(s), int64(ns))
	return s
}
22164
func (l *HandlerList) PushBackNamed(n NamedHandler) {
	if cap(l.list) == 0 {
		l.list = make([]NamedHandler, 0, 5)
	}
	l.list = append(l.list, n)
}
1265538
func (m Method) DeclarationNamed(receiver string) string {
	return fmt.Sprintf("func (%s %s) %s%s %s", receiverShort(receiver), receiver, m.Name, m.inStr(), m.outStrNamed())
}
1339945
func NamedQuery(e Ext, query string, arg interface{}) (*Rows, error) {
	q, args, err := bindNamedMapper(BindType(e.DriverName()), query, arg, mapperFor(e))
	if err != nil {
		return nil, err
	}
	return e.Queryx(q, args...)
}
472874
func (db *DB) BindNamed(query string, arg interface{}) (string, []interface{}, error) {
	return bindNamedMapper(BindType(db.driverName), query, arg, db.Mapper)
}
374177
func (c *ChatUpdateCall) Timestamp(timestamp string) *ChatUpdateCall {
	c.timestamp = timestamp
	return c
}
1180523
func (c Context) Timestamp() Context {
	c.l = c.l.Hook(th)
	return c
}
599847
func GetNamed(ttype Type) Named {
	unmodifiedType := ttype
	for {
		switch typ := unmodifiedType.(type) {
		case *List:
			unmodifiedType = typ.OfType
		case *NonNull:
			unmodifiedType = typ.OfType
		default:
			return unmodifiedType
		}
	}
}
1306868
func (tx *Tx) NamedQuery(query string, arg interface{}) (*Rows, error) {
	return NamedQuery(tx, query, arg)
}