Query all rows and columns from a table.
174675
def select_all(self, table, limit=MAX_ROWS_PER_QUERY, execute=True):
        """"""
        # Determine if a row per query limit should be set
        num_rows = self.count_rows(table)
        if num_rows > limit:
            return self._select_batched(table, '*', num_rows, limit, execute=execute)
        else:
            return self.select(table, '*', execute=execute)
748584
def fetch(table, cols="*", where=(), group="", order=(), limit=(), **kwargs):
    """"""
    return select(table, cols, where, group, order, limit, **kwargs).fetchall()
25180
def get_column_keys_and_names(table):
    
    ins = inspect(table)
    return ((k, c.name) for k, c in ins.mapper.c.items())
824375
def filter(self, table, items, filter_string):
        """"""
        query = filter_string.lower()
        return [item for item in items
                if query in item.name.lower()]
65674
def get_column_definition_all(self, table):
        """"""
        # Get complete table definition
        col_defs = self.get_table_definition(table).split('\n')

        # Return only column definitions
        return [i[0:-1].strip().replace(',', ', ') for i in col_defs if i.strip().startswith('`')]
713820
def select(query, data=None):
    
    connection = _State.connection()
    _State.new_transaction()
    if data is None:
        data = []

    result = connection.execute('select ' + query, data)

    rows = []
    for row in result:
        rows.append(dict(list(row.items())))

    return rows
678202
def read(database, table, key):
    """"""
    with database.snapshot() as snapshot:
        result = snapshot.execute_sql('SELECT u.* FROM %s u WHERE u.id="%s"' %
                                      (table, key))
        for row in result:
            key = row[0]
        for i in range(NUM_FIELD):
            field = row[i + 1]
418015
def _query_iterator(self, result, chunksize, columns, coerce_float=True,
                        parse_dates=None):
        """"""

        while True:
            data = result.fetchmany(chunksize)
            if not data:
                break
            else:
                self.frame = DataFrame.from_records(
                    data, columns=columns, coerce_float=coerce_float)

                self._harmonize_columns(parse_dates=parse_dates)

                if self.index is not None:
                    self.frame.set_index(self.index, inplace=True)

                yield self.frame
479743
def query_all(**kwargs):
        '''
        
        '''
        kind = kwargs.get('kind', '1')
        limit = kwargs.get('limit', 50)

        return TabWiki.select().where(TabWiki.kind == kind).limit(limit)
1148455
async def fetchall(self) -> Iterable[sqlite3.Row]:
        """"""
        return await self._execute(self._cursor.fetchall)
810039
def fetchone(table, cols="*", where=(), group="", order=(), limit=(), **kwargs):
    """"""
    return select(table, cols, where, group, order, limit, **kwargs).fetchone()
278051
function findAllColumnNames(rows) {
  const columnNames = []

  for (let i = 0; i < rows.length; i++) {
    for (let key in rows[i]) {
      if (columnNames.includes(key)) {
        continue
      }

      columnNames.push(key)
    }
  }

  return columnNames
}
1232043
def get_database_columns(self, tables=None, database=None):
        """"""
        # Get table data and columns from source database
        source = database if database else self.database
        tables = tables if tables else self.tables
        return {tbl: self.get_columns(tbl) for tbl in tqdm(tables, total=len(tables),
                                                           desc='Getting {0} columns'.format(source))}
944239
def select(table, cols="*", where=(), group="", order=(), limit=(), **kwargs):
    """"""
    where = dict(where, **kwargs).items()
    sql, args = makeSQL("SELECT", table, cols, where, group, order, limit)
    return execute(sql, args)
563452
def query(name):
    """"""
    collection = Collection.query.filter_by(name=name).one()
    click.echo(collection.dbquery)
513832
def all(self, command, params=None):
        
        dr = self.query(command, params)
        return dr['rows']
542995
def get_database_rows(self, tables=None, database=None):
        """"""
        # Get table data and columns from source database
        source = database if database else self.database
        tables = tables if tables else self.tables

        # Get database select queries
        commands = self._get_select_commands(source, tables)

        # Execute select commands
        return self._execute_select_commands(source, commands)