// Get data from database populating ReservasCollection
350397
func GetReservas() ReservasCollection {

	t := time.Now()
	q := `SELECT clau, data, nits, limpieza, llegada, 
			CONCAT(b.tipus, " ", b.title) as apartament,
			CONCAT(c.nom, " ", c.cognom) as client 
		FROM reserves_reserva as a LEFT join crm_client as c on a.client_id = c.id
		LEFT JOIN reserves_apartament as b on a.apartament_id = b.id
		WHERE data>=? and a.status<=3`

	reservas := ReservasCollection{}
	err := Db.Select(&reservas, q, t.Format("2006-01-02"))
	_ = Db.Unsafe()
	if err != nil {
		log.Println(err)
	}
	return reservas
}
1204124
func (i *EncryptedDB) Get(ctx context.Context, key libkb.DbKey, res interface{}) (bool, error) {
	var err error
	db := i.getDB(i.G())
	b, found, err := db.GetRaw(key)
	if err != nil {
		return false, err
	}
	if !found {
		return false, nil
	}
	if err = DecodeBox(ctx, b, i.getSecretBoxKey, res); err != nil {
		return false, err
	}
	return true, nil
}
34545
func (s *Server) Get(ctx context.Context, q *ClusterQuery) (*appv1.Cluster, error) {
	if err := s.enf.EnforceErr(ctx.Value("claims"), rbacpolicy.ResourceClusters, rbacpolicy.ActionGet, q.Server); err != nil {
		return nil, err
	}
	clust, err := s.db.GetCluster(ctx, q.Server)
	return redact(clust), err
}
922048
func getCollectionMB(coll *mgo.Collection) (int, error) {
	var result bson.M
	err := coll.Database.Run(bson.D{
		{"collStats", coll.Name},
		{"scale", humanize.MiByte},
	}, &result)
	if err != nil {
		return 0, errors.Trace(err)
	}
	return dbCollectionSizeToInt(result, coll.Name)
}
551011
func (tc *serverTransportCredentials) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {
	return nil, nil
}
1109163
func (db *CLevelDB) Get(key []byte) []byte {
	key = nonNilBytes(key)
	res, err := db.db.Get(db.ro, key)
	if err != nil {
		panic(err)
	}
	return res
}
741703
func (ds *MySQLDatastore) Get(ctx context.Context, key []byte) ([]byte, error) {
	row := ds.db.QueryRow("SELECT value FROM extras WHERE id=?", key)

	var value string
	err := row.Scan(&value)
	if err == sql.ErrNoRows {
		return nil, nil
	} else if err != nil {
		return nil, err
	}

	return []byte(value), nil
}
732691
func (db *Database) Get(key []byte) ([]byte, error) {
	db.lock.RLock()
	defer db.lock.RUnlock()

	if db.db == nil {
		return nil, errMemorydbClosed
	}
	if entry, ok := db.db[string(key)]; ok {
		return common.CopyBytes(entry), nil
	}
	return nil, errMemorydbNotFound
}
952196
func (sud *StaticUserData) Get() *querypb.VTGateCallerID {
	return &querypb.VTGateCallerID{Username: sud.username, Groups: sud.groups}
}
1230440
func (m *Manager) getRefreshTokenCollection() *mgo.Collection {
	return db.GetCollection(m.session, refreshTokenCollectionName)
}
241769
func (db *DB) Get(dest interface{}, query string, args ...interface{}) error {
	return Get(db, dest, query, args...)
}
599349
func (u *user) GetDatabaseAccess(ctx context.Context, db Database) (Grant, error) {
	dbName, _, err := getDatabaseAndCollectionName(db)
	if err != nil {
		return GrantNone, WithStack(err)
	}
	escapedDbName := pathEscape(dbName)
	req, err := u.conn.NewRequest("GET", path.Join(u.relPath(), "database", escapedDbName))
	if err != nil {
		return GrantNone, WithStack(err)
	}
	applyContextSettings(ctx, req)
	resp, err := u.conn.Do(ctx, req)
	if err != nil {
		return GrantNone, WithStack(err)
	}
	if err := resp.CheckStatus(200); err != nil {
		return GrantNone, WithStack(err)
	}

	var data getAccessResponse
	if err := resp.ParseBody("", &data); err != nil {
		return GrantNone, WithStack(err)
	}
	return Grant(data.Result), nil
}
1171780
func (obj *Doc) GetDatabasesRaw(ctx context.Context, connectionId string) (json.RawMessage, error) {
	result := &struct {
		Databases json.RawMessage	`json:"qDatabases"`
	} {}
	err := obj.rpc(ctx, "GetDatabases", result, ensureEncodable(connectionId))
	return result.Databases, err 
}
1298934
func (d *database) Collections(ctx context.Context) ([]Collection, error) {
	req, err := d.conn.NewRequest("GET", path.Join(d.relPath(), "_api/collection"))
	if err != nil {
		return nil, WithStack(err)
	}
	resp, err := d.conn.Do(ctx, req)
	if err != nil {
		return nil, WithStack(err)
	}
	if err := resp.CheckStatus(200); err != nil {
		return nil, WithStack(err)
	}
	var data getCollectionResponse
	if err := resp.ParseBody("", &data); err != nil {
		return nil, WithStack(err)
	}
	result := make([]Collection, 0, len(data.Result))
	for _, info := range data.Result {
		col, err := newCollection(info.Name, d)
		if err != nil {
			return nil, WithStack(err)
		}
		result = append(result, col)
	}
	return result, nil
}
712317
func (obj *Doc) GetDatabases(ctx context.Context, connectionId string) ([]*Database, error) {
	result := &struct {
		Databases []*Database	`json:"qDatabases"`
	} {}
	err := obj.rpc(ctx, "GetDatabases", result, connectionId)
	return result.Databases, err 
}
995660
func (db *Database) Get(key []byte) ([]byte, error) {
	dat, err := db.db.Get(key, nil)
	if err != nil {
		return nil, err
	}
	return dat, nil
}
725016
func Get(dbName string) (Db, error) {
	if db, ok := connectionMap[dbName]; ok {
		return db, nil
	}
	return Db{}, errors.New("Database connection not available. Perform 'Setup' first")
}