// Value implements the database/sql/driver Valuer interface.
483731
func (src *Int2) Value() (driver.Value, error) {
	switch src.Status {
	case Present:
		return int64(src.Int), nil
	case Null:
		return nil, nil
	default:
		return nil, errUndefined
	}
}
666523
func (v Vars) Value() (driver.Value, error) {
	m := make(map[string]sql.NullString)

	for k, v := range v {
		m[string(k)] = sql.NullString{
			Valid:  true,
			String: *v,
		}
	}

	h := hstore.Hstore{
		Map: m,
	}

	return h.Value()
}
484489
func (n NullTime) Value() (driver.Value, error) {
	if !n.Valid {
		return nil, nil
	}
	return n.Time, nil
}
1002047
func (itr *memDBIterator) Value() []byte {
	itr.assertIsValid()
	key := []byte(itr.keys[itr.cur])
	return itr.db.Get(key)
}
576607
func (setting Setting) Value() (driver.Value, error) {
	result, err := json.Marshal(setting)
	return string(result), err
}
350095
func (c Certs) Value() (driver.Value, error) {
	if c == nil {
		return nil, nil
	}

	raw, err := json.Marshal(c)
	if err != nil {
		return nil, err
	}

	return driver.Value(raw), nil
}
356965
func (f Float64) Value() (driver.Value, error) {
	if !f.Valid {
		return nil, nil
	}
	return f.Float64, nil
}
715944
func (src *Float8) Value() (driver.Value, error) {
	switch src.Status {
	case Present:
		return src.Float, nil
	case Null:
		return nil, nil
	default:
		return nil, errUndefined
	}
}
1106842
func (p *Point) Value() (driver.Value, error) {
	if p.Point == nil {
		return nil, nil
	}
	return value(p.Point)
}
568944
func (d Date) Value() (driver.Value, error) {
	year, month, day := d.Date()
	return time.Date(year, month, day, 0, 0, 0, 0, time.UTC), nil
}
826307
func (p *Polygon) Value() (driver.Value, error) {
	if p.Polygon == nil {
		return nil, nil
	}
	return value(p.Polygon)
}
632985
func (mls *MultiLineString) Value() (driver.Value, error) {
	if mls.MultiLineString == nil {
		return nil, nil
	}
	return value(mls.MultiLineString)
}
1274552
func (w *KeyedValue) Value(k string) interface{} {
	w.lock.Lock()
	v, val := w.valueWaiter(k)
	w.lock.Unlock()

	// If we have no waiter, then return the value
	if val == nil {
		return v
	}

	// We have a waiter, so wait
	return val.Value()
}
416956
func (f Float32) Value() (driver.Value, error) {
	if !f.Valid {
		return nil, nil
	}
	return f.Float32, nil
}
297853
func (v *NowValuer) Value(key string) (interface{}, bool) {
	if !v.Now.IsZero() && key == "now()" {
		return v.Now, true
	}
	return nil, false
}
1325533
func (src *Bool) Value() (driver.Value, error) {
	switch src.Status {
	case Present:
		return src.Bool, nil
	case Null:
		return nil, nil
	default:
		return nil, errUndefined
	}
}
309273
func (b Base) Value() (driver.Value, error) {
	if b.Delete {
		return nil, nil
	}

	results, err := json.Marshal(b)
	return string(results), err
}