Flush the specified names from the specified databases.

    This can be highly destructive as it destroys all data.
322193
def flush(**kwargs):
    

    expression = lambda target, table: target.execute(table.delete())
    test = lambda target, table: not table.exists(target)
    op(expression, reversed(metadata.sorted_tables), test=test,
       primary='flush', secondary='flush', **kwargs)
316846
def purge(self, name=None):
        
        self.disconnect(name)

        if name in self._connections:
            del self._connections[name]
496483
def flush(bank, key=None):
    '''
    
    '''
    _init_client()
    query = "DELETE FROM {0} WHERE bank='{1}'".format(_table_name, bank)
    if key is not None:
        query += " AND etcd_key='{0}'".format(key)

    cur, _ = run_query(client, query)
    cur.close()
106570
def clear(**kwargs):
    

    database = kwargs.pop('database', False)
    expression = lambda target, table: table.drop(target)
    test = lambda x, tab: not database_exists(x.url) or not tab.exists(x)

    # TODO: Iterate through all engines in name set.
    if database and database_exists(engine['default'].url):
        drop_database(engine['default'].url)
        clear_cache()

    op(expression, reversed(metadata.sorted_tables), test=test,
       primary='clear', secondary='drop', **kwargs)
1058755
protected function cleanupDB()
    {
        $eresus = Eresus_CMS::getLegacyKernel();
        $tables = $eresus->db
            ->query_array("SHOW TABLES LIKE '{$eresus->db->prefix}{$this->getName()}_%'");
        $tables = array_merge($tables, $eresus->db->
            query_array("SHOW TABLES LIKE '{$eresus->db->prefix}{$this->getName()}'"));
        for ($i = 0; $i < count($tables); $i++)
        {
            $this->dbDropTable(substr(current($tables[$i]), strlen($this->getName()) + 1));
        }
    }
569653
def delete(self, *names):
        
        names = [self.redis_key(n) for n in names]
        with self.pipe as pipe:
            return pipe.delete(*names)
537024
def close_databases(self):
        
        if self.gc_book:
            self.gc_book.close()
        if self.pricedb_session:
            self.pricedb_session.close()
516219
def clear():
    
    utils.check_for_local_server()
    click.confirm(
        "Are you sure you want to do this? It will delete all of your data",
        abort=True
    )
    server = Server(config["local_server"]["url"])
    for db_name in all_dbs:
        del server[db_name]
1320008
public void cleanDataSources() {

        Hashtable<String, List<String>> removedDsKeyTable = null;

        //gather all the empty ds's key, can't remove item while iterate
        Enumeration<String> allPoolKeys = dbmsPoolTable.keys();
        while (allPoolKeys.hasMoreElements()) {
            String dbPoolKey = allPoolKeys.nextElement();
            Hashtable<String, DataSource> dsTable = dbmsPoolTable.get(dbPoolKey);
            Enumeration<String> allDsKeys = dsTable.keys();
            while (allDsKeys.hasMoreElements()) {
                String dsKey = allDsKeys.nextElement();
                DataSource ds = dsTable.get(dsKey);

                //c3p0 impl
                if (ds != null && ds instanceof PooledDataSource) {
                    PooledDataSource pDs = (PooledDataSource) ds;
                    int conCount;
                    try {
                        conCount = pDs.getNumConnectionsAllUsers();
                    } catch (SQLException e) {
//                  todo      logger.error
//                                ("Failed to get total number of connections for datasource. dbmsPoolKey = "
//                                        + dbPoolKey, e);
                        continue;
                    }
                    //no connections
                    if (conCount == 0) {
                        List<String> removedList = null;
                        if (removedDsKeyTable == null) {
                            removedDsKeyTable = new Hashtable<>();
                        } else {
                            removedList = removedDsKeyTable.get(dbPoolKey);
                        }

                        if (removedList == null) {
                            removedList = new ArrayList<>();
                            removedList.add(dsKey);
                            removedDsKeyTable.put(dbPoolKey, removedList);
                        } else {
                            removedList.add(dsKey);
                        }
                    }
                }
            }
        }

        //have empty ds
        if (removedDsKeyTable != null && !removedDsKeyTable.isEmpty()) {
            Enumeration<String> removedPoolKeys = removedDsKeyTable.keys();
            while (removedPoolKeys.hasMoreElements()) {
                String removedPoolKey = removedPoolKeys.nextElement();
                PooledDataSourceProvider provider = this.getProvider(removedPoolKey);
                List<String> removedDsList = removedDsKeyTable.get(removedPoolKey);
                Hashtable<String, DataSource> dsTable = dbmsPoolTable.get(removedPoolKey);
                for (String dsKey : removedDsList) {
                    DataSource removedDs = dsTable.remove(dsKey);
                    try {
                        provider.closePooledDataSource(removedDs);
                    } catch (SQLException e) {
                        //can't show the dsKey since it has encrypted password there
//                  todo      logger.error("Failed to close datadsource in dmbs poolKey = "
//                                + removedPoolKey, e);
                        continue;
                    }

                    //tracing
//                todo    if (logger.isDebugEnabled()) {
//                        logger.debug("Removed one datasource in dbms poolKey = "
//                                + removedPoolKey);
//                    }
                }
                //don't have any ds for the pool key
                if (dsTable.isEmpty()) {
                    dbmsPoolTable.remove(removedPoolKey);
                    //tracing
//              todo      if (logger.isDebugEnabled()) {
//                        logger.debug("Removed dbms poolKey = " + removedPoolKey);
//                    }
                }
            }
        }
    }
1162000
def _FlushAllRows(self, db_connection, table_name):
    """"""
    for sql in db_connection.iterdump():
      if (sql.startswith("CREATE TABLE") or
          sql.startswith("BEGIN TRANSACTION") or sql.startswith("COMMIT")):
        # These statements only need to be written once.
        continue
      # The archive generator expects strings (not Unicode objects returned by
      # the pysqlite library).
      yield self.archive_generator.WriteFileChunk((sql + "\n").encode("utf-8"))
    with db_connection:
      db_connection.cursor().execute("DELETE FROM \"%s\";" % table_name)
1076082
def flushIndexes(cls) :
		""
		con = RabaConnection(cls._raba_namespace)
		for idx in cls.getIndexes() :
			con.dropIndexByName(idx[1])
932605
def flushIndexes(self) :
		""
		for n in self.getIndexes(rabaOnly = True) :
			self.dropIndexByName(n[1])
132583
def _flush_ndb_deletes(self, items, options):
    """"""
    assert ndb is not None
    ndb.delete_multi(items, config=self._create_config(options))
203931
public void destroy()
    {
        removeAllListeners();
        if (connectionManager != null)
        {
            if(connectionManager.isInLocalTransaction())
            {
                connectionManager.localRollback();
            }
            connectionManager.releaseConnection();
        }
        this.setClosed(true);

        this.descriptorRepository = null;
        this.pbKey = null;
        this.pbf = null;
        this.connectionManager = null;
        this.dbAccess = null;
        this.objectCache = null;
        this.sequenceManager = null;
        this.sqlGenerator = null;
        this.statementManager = null;
    }
1188808
public function deleteAll() {

        $tablenames = $this->getAllTableNames();
        foreach ($tablenames as $tablename) {
            $this->databaseConnection->query("DROP TABLE " . $tablename);
        }

    }
1145947
private static void deRegisterServer(Server server, Database db) {

        Iterator it = serverMap.values().iterator();

        for (; it.hasNext(); ) {
            HashSet databases = (HashSet) it.next();

            databases.remove(db);

            if (databases.isEmpty()) {
                it.remove();
            }
        }
    }
29342
public void clear() {
		for (Bean bean : beans.values()) {
			if (null != bean.destructionCallback) {
				bean.destructionCallback.run();
			}
		}
		beans.clear();
	}