Cache all table names if necessary
353367
protected function cacheTableNames()
    {
        if ($this->tableNames) {
            return;
        }
        $this->tableNames = [];
        foreach (ClassInfo::subclassesFor(DataObject::class) as $class) {
            if ($class === DataObject::class) {
                continue;
            }
            $table = $this->buildTableName($class);

            // Check for conflicts
            $conflict = array_search($table, $this->tableNames, true);
            if ($conflict) {
                throw new LogicException(
                    "Multiple classes (\"{$class}\", \"{$conflict}\") map to the same table: \"{$table}\""
                );
            }
            $this->tableNames[$class] = $table;
        }
    }
1217283
function loadUncachedAll () {
    // debug
    debug('id:loadUncachedAll')
    // execute original query
    return this.query.executeQuery()
    // cache result
    .then(results => {
        // cache results if there are any
        if (results.length > 0) {
            // cache results - do not wait to complete
            this.cacheResults(results)
        }
        // resolve with results
        return results
    })
}
484229
def db(context, data):
    """"""
    table = context.params.get("table", context.crawler.name)
    params = context.params
    params["table"] = table
    _recursive_upsert(context, params, data)
763338
def db_tables(name, **connection_args):
    '''
    
    '''
    if not db_exists(name, **connection_args):
        log.info('Database \'%s\' does not exist', name)
        return False

    dbc = _connect(**connection_args)
    if dbc is None:
        return []
    cur = dbc.cursor()
    s_name = quote_identifier(name)
    # identifiers cannot be used as values
    qry = 'SHOW TABLES IN {0}'.format(s_name)
    try:
        _execute(cur, qry)
    except MySQLdb.OperationalError as exc:
        err = 'MySQL Error {0}: {1}'.format(*exc.args)
        __context__['mysql.error'] = err
        log.error(err)
        return []

    ret = []
    results = cur.fetchall()
    for table in results:
        ret.append(table[0])
    log.debug(ret)
    return ret
461802
private function getAllTableNames()
    {
        $handler = $this->databaseConnection->queryAndHandle("SHOW TABLES FROM `" . $this->databaseConnection->getDatabaseName() . "`");
        $tableNames = array();

        if ($handler->getResultSize() > 0) {
            while ($oDatabaseResultRow = $handler->fetchNextResultObject()) {
                $tablesInVariableName = "Tables_in_" . $this->databaseConnection->getDatabaseName();
                // add only tables with the current connection prefix
                if (
                    substr(
                        $oDatabaseResultRow->$tablesInVariableName,
                        0,
                        strlen($this->databaseConnection->getTablePrefix()))
                    == $this->databaseConnection->getTablePrefix()) {

                    array_push($tableNames, $oDatabaseResultRow->$tablesInVariableName);
                }

            }
        }

        return $tableNames;
    }
700886
public void cacheIncludeAndIgnore(WebElement table) {
        if (getIgnoreByMatches() == null) {
            setIgnoreByMatches(new ArrayList<WebElement>());
            for (By by : getIgnoreRowsMatching()) {
                getIgnoreByMatches().addAll(table.findElements(by));
            }
        }
        if (getIncludeByMatches() == null) {
            setIncludeByMatches(new ArrayList<WebElement>());
            for (By by : getIncludeOnlyRowsMatching()) {
                getIncludeByMatches().addAll(table.findElements(by));
            }
        }
    }
694902
private synchronized void startCache()
    {
        for (PDatabase pDatabase : m_htDBList.values())
        {
            for (PTable pTable : pDatabase.getTableList().values())
            {
                this.addTableToCache(pTable);
            }
        }
    }
518291
def _update_cache(self):
        
        fields = connections[self.connection_alias].get_unified_index().all_searchfields()
        if self._fields != fields:
            self._fields = fields
            self._content_field_name, self._schema = self.build_schema(self._fields)
650466
def get(self, table_name):
        """"""
        assert table_name in self.tabs, \
            "Table not avaiable. Avaiable tables: {}".format(
                ", ".join(self.tabs.keys())
            )
        return self.tabs[table_name]
112621
def flush(self):
        """"""
        self.log.info('Flushing tables and arrays to disk...')
        for tab in self._tables.values():
            tab.flush()
        self._write_ndarrays_cache_to_disk()
959719
def has_table(self, name):
        """"""
        return len(self.sql("SELECT name FROM sqlite_master WHERE type='table' AND name=?",
                            parameters=(name,), asrecarray=False, cache=False)) > 0
911869
def cache(self):
      """"""
      msg = 'Saving updates from more recent "%s" to "%s"'
      log.info(msg, self.filename, self.cachename)
      with open(self.cachename, 'wb') as output:
          cPickle.dump(self._dict, output, -1)
1122837
def get_tables_for_bind(self, bind=None):
        """"""
        result = []
        for table in itervalues(self.Model.metadata.tables):
            if table.info.get('bind_key') == bind:
                result.append(table)
        return result
605465
def _load_info(self):
    """"""
    if self._info is None:
      try:
        self._info = self._api.tables_get(self._name_parts)
      except Exception as e:
        raise e
33741
def init(context, reset, force):
    """"""
    existing_tables = context.obj['store'].engine.table_names()
    if force or reset:
        if existing_tables and not force:
            message = f"Delete existing tables? [{', '.join(existing_tables)}]"
            click.confirm(click.style(message, fg='yellow'), abort=True)
        context.obj['store'].drop_all()
    elif existing_tables:
        click.echo(click.style("Database already exists, use '--reset'", fg='red'))
        context.abort()

    context.obj['store'].setup()
    message = f"Success! New tables: {', '.join(context.obj['store'].engine.table_names())}"
    click.echo(click.style(message, fg='green'))
1159206
private boolean storeExists(String tableName) {
        KeyspaceMetadata ksMetadata = m_cluster.getMetadata().getKeyspace(m_keyspace);
        return (ksMetadata != null) && (ksMetadata.getTable(tableName) != null);
    }
656643
def table_absent(name, db):
    '''
    
    '''
    changes = {'name': name,
               'changes': {},
               'result': None,
               'comment': ''}
    conn = None
    try:
        conn = sqlite3.connect(db, detect_types=sqlite3.PARSE_DECLTYPES)
        tables = _query(conn, "SELECT sql FROM sqlite_master " +
                              " WHERE type='table' AND name=?", [name])

        if len(tables) == 1:
            if __opts__['test']:
                changes['result'] = True
                changes['comment'] = "'" + name + "' will be dropped"
            else:
                conn.execute("DROP TABLE " + name)
                conn.commit()
                changes['changes']['old'] = tables[0][0]
                changes['result'] = True
                changes['comment'] = "'" + name + "' was dropped"
        elif not tables:
            changes['result'] = True
            changes['comment'] = "'" + name + "' is already absent"
        else:
            changes['result'] = False
            changes['comment'] = "Multiple tables with the same name='" + \
                                 name + "'"

    except Exception as e:
        changes['result'] = False
        changes['comment'] = six.text_type(e)

    finally:
        if conn:
            conn.close()

    return changes