()
return all_dbs
Return an ordered dict of (dbname: database). The order is
    according to search preference, the first DB to contain a document
    should be assumed to be the authoritative one.
Return an ordered dict of (dbname: database). The order is
    according to search preference, the first DB to contain a document
    should be assumed to be the authoritative one.
Return an ordered dict of ( dbname : database ) . The order is according to search preference the first DB to contain a document should be assumed to be the authoritative one .
def get_databases():
    """Return an ordered dict of (dbname: database). The order is
    according to search preference, the first DB to contain a document
    should be assumed to be the authoritative one."""
    sql_dbs = [
        _SQLDb(
            XFormInstanceSQL._meta.db_table,
            lambda id_: XFormInstanceSQL.get_obj_by_id(id_),
            "XFormInstance",
            lambda doc: XFormInstanceSQLRawDocSerializer(doc).data,
        ),
        _SQLDb(
            CommCareCaseSQL._meta.db_table,
            lambda id_: CommCareCaseSQL.get_obj_by_id(id_),
            "CommCareCase",
            lambda doc: CommCareCaseSQLRawDocSerializer(doc).data,
        ),
        _SQLDb(
            SQLLocation._meta.db_table,
            lambda id_: SQLLocation.objects.get(location_id=id_),
            'Location',
            lambda doc: doc.to_json()
        ),
    ]

    all_dbs = OrderedDict()
    for db in sql_dbs:
        all_dbs[db.dbname] = db
    couchdbs_by_name = couch_config.all_dbs_by_db_name
    for dbname in sorted(couchdbs_by_name):
        all_dbs[dbname] = _CouchDb(couchdbs_by_name[dbname])
    return all_dbs
def get_databases ( ) : sql_dbs = [ _SQLDb ( XFormInstanceSQL . _meta . db_table , lambda id_ : XFormInstanceSQL . get_obj_by_id ( id_ ) , "XFormInstance" , lambda doc : XFormInstanceSQLRawDocSerializer ( doc ) . data , ) , _SQLDb ( CommCareCaseSQL . _meta . db_table , lambda id_ : CommCareCaseSQL . get_obj_by_id ( id_ ) , "CommCareCase" , lambda doc : CommCareCaseSQLRawDocSerializer ( doc ) . data , ) , _SQLDb ( SQLLocation . _meta . db_table , lambda id_ : SQLLocation . objects . get ( location_id = id_ ) , 'Location' , lambda doc : doc . to_json ( ) ) , ] all_dbs = OrderedDict ( ) for db in sql_dbs : all_dbs [ db . dbname ] = db couchdbs_by_name = couch_config . all_dbs_by_db_name for dbname in sorted ( couchdbs_by_name ) : all_dbs [ dbname ] = _CouchDb ( couchdbs_by_name [ dbname ] ) return all_dbs