get a collection of records by table name.
        returns a collection of SnowRecord obj.
544136
def list(self,table, **kparams):
        
        records = self.api.list(table, **kparams)
        return records
405625
def get_records_with_attachments(attachment_table, rel_object_field="REL_OBJECTID"):
    """"""
    if arcpyFound == False:
        raise Exception("ArcPy is required to use this function")
    OIDs = []
    with arcpy.da.SearchCursor(attachment_table,
                               [rel_object_field]) as rows:
        for row in rows:
            if not str(row[0]) in OIDs:
                OIDs.append("%s" % str(row[0]))
            del row
    del rows
    return OIDs
655399
def _get_column_by_db_name(cls, name):
        
        return cls._columns.get(cls._db_map.get(name, name))
250120
def get_collection(self, collection, **kwargs):
        
        query = kwargs.get('query', {})
        projection = kwargs.get('projection', {})
        projection = None if len(projection) < 1 else projection
        limit = kwargs.get('limit', 0)  # no limit by default
        # sort = kwargs.get('sort', {})
        logging.info("About to get a collection from the database")
        logging.debug("Collection: {}".format(collection))
        logging.debug("Query: {}".format(query))
        logging.debug("Projection: {}".format(projection))
        logging.debug("Limit: {}".format(limit))
        records = \
            list(self.db[collection].find(query, projection).limit(limit))
        logging.debug("Got {} results".format(len(records)))
        return records
1294181
def get_records(self, zone_name):
        
        records = self._client.get('/domain/zone/{}/record'.format(zone_name))
        return [self.get_record(zone_name, record_id) for record_id in records]
1288340
def get_tables(self, db_name, pattern):
    
    self.send_get_tables(db_name, pattern)
    return self.recv_get_tables()
378728
def table(self, name: str):
        
        if self._check_db() == False:
            return
        try:
            res = self.getall(name)
        except Exception as e:
            self.err(e, self.table, "Can not get records from database")
            return
        if res is None:
            self.warning("Table", name, "does not contain any record")
            return
        num = len(res)
        self.info(num, "rows")
        self.info("Fields:", ", ".join(list(res)))
245073
def get_table_names(self, connection, schema=None, **kw):
        
        return self._get_table_or_view_names('r', connection, schema, **kw)
54877
def getUnionRecords(tables,fieldNames)
      unionRecords = []
      iterateUnionRecords(tables,fieldNames) { |unionRecord| 
         unionRecords << unionRecord.dup 
      }
      unionRecords
   end
233694
def iterateRecords( dbid, fieldNames, query = nil, qid = nil, qname = nil, clist = nil, slist = nil, fmt = "structured", options = nil )
      if block_given?   
         queryResults = getAllValuesForFields(dbid,fieldNames,query,qid,qname,clist,slist,fmt,options)
         if queryResults
            numRecords = 0
            numRecords = queryResults[fieldNames[0]].length if queryResults[fieldNames[0]]
            (0..(numRecords-1)).each{|recNum|
               recordHash = {}
               fieldNames.each{|fieldName|
                  recordHash[fieldName]=queryResults[fieldName][recNum]
               }
               yield recordHash
            }
         end
      else
         raise "'iterateRecords' must be called with a block."
      end
   end
76104
protected Table getTableFromDB(String tableName) {
        Table table = m_db.getTables().getExact(tableName);
        return table;
    }
1098505
def get_record(self, name):
        

        result = {}
        result.update(self.records.get(name, {}))
        return result
929279
def fetch_all_objects_from_db_by_pklist(self,
                                            cls: Type,
                                            table: str,
                                            fieldlist: Sequence[str],
                                            pklist: Sequence[Any],
                                            construct_with_pk: bool,
                                            *args) -> List[T]:
        """"""
        objarray = []
        for pk in pklist:
            if construct_with_pk:
                obj = cls(pk, *args)  # should do its own fetching
            else:
                obj = cls(*args)
                self.fetch_object_from_db_by_pk(obj, table, fieldlist, pk)
            objarray.append(obj)
        return objarray
833724
def run_query(self, query):
        
        collection = self.ds.connection(self.collection_name)

        cursor = collection.find(query)
        if cursor.count() == 0:
            raise LookupError('Collection {0} has no {1} records'
                              .format(self.collection_name, self.model_klass.__name__))
        return [self.model_klass.from_json(entry) for entry in cursor]
1213641
function (connectionName, collectionName, cb) {

      var connectionObject = connections[connectionName];
      if (!connectionObject) return cb(Errors.InvalidConnection);

      var collection = connectionObject.collections[collectionName];
      if (!collection) return cb(Errors.CollectionNotRegistered);

      collection.describeTable(cb);
    }
1264048
def getTableName(dbid)
      tableName = nil 
      dbid ||= @dbid
      if getSchema(dbid)
        tableName = getResponseElement( "table/name" ).text
      end
      tableName
   end
623886
def get_instance(self, collection, obj_id, **kwargs):
        
        logging.info("Getting single record")
        try:
            obj_id = ObjectId(obj_id)
        except InvalidId:
            logging.error("Invalid ObjectId: {}".format(obj_id))
            return {}
        projection = kwargs.get('projection', {})
        projection = None if len(projection) < 1 else projection
        query = kwargs.get('query', {})
        query.update({'_id': obj_id})
        logging.debug("Query: {}".format(query))
        logging.debug("Projection: {}".format(projection))
        record = self.db[collection].find_one(query, projection)
        return record