Drop database tables
485804
def dropdb():
    """"""
    manager.db.engine.echo = True
    if prompt_bool("Are you sure you want to lose all your data"):
        manager.db.drop_all()
        metadata, alembic_version = alembic_table_metadata()
        alembic_version.drop()
        manager.db.session.commit()
363975
def drop_db():
    "  "

    from ..ext import db

    if prompt_bool("Are you sure? You will lose all your data!"):
        db.drop_all()

        # Evolution support
        from flask import current_app
        from flaskext.evolution import db as evolution_db
        evolution_db.init_app(current_app)
        evolution_db.drop_all()

        print "Database clearing"
98724
def delete(self, drop_database=True):
        
        self.disable()
        Session.delete(self)

        if drop_database and self.db_name:
            mysql = create_engine('mysql://root:secret@localhost')
            mysql.execute('DROP DATABASE IF EXISTS `{db}`'.format(db=self.db_name))
            try:
                mysql.execute('DROP USER `{u}`'.format(u=self.db_user))
            except SQLAlchemyError:
                pass
684175
async def _drop_databases(cls) -> None:
        
        if not cls._inited:
            raise ConfigurationError("You have to call .init() first before deleting schemas")
        for connection in cls._connections.values():
            await connection.close()
            await connection.db_delete()
        cls._connections = {}
        await cls._reset_apps()
577651
def dropdb(force=False):
    """"""

    if force:
        logger.info(
            "Terminating any other connections to %s on %s",
            repr(DB["NAME"]),
            repr(DB["HOST"]),
        )
        kill_other_psql_sessions()

    logger.info("Dropping database %s", repr(DB["NAME"]))
    return shell('dropdb -U "{USER}" -h "{HOST}" "{NAME}"'.format(**DB))
691368
def db_remove(database_name, **kwargs):
    '''
    
    '''
    try:
        if db_exists(database_name, **kwargs) and database_name not in ['master', 'model', 'msdb', 'tempdb']:
            conn = _get_connection(**kwargs)
            conn.autocommit(True)
            cur = conn.cursor()
            cur.execute('ALTER DATABASE {0} SET SINGLE_USER WITH ROLLBACK IMMEDIATE'.format(database_name))
            cur.execute('DROP DATABASE {0}'.format(database_name))
            conn.autocommit(False)
            conn.close()
            return True
        else:
            return False
    except Exception as e:
        return 'Could not find the database: {0}'.format(e)
1146323
def drop_table_or_view(self, name, database=None, force=False):
        
        try:
            self.drop_table(name, database=database)
        except Exception as e:
            try:
                self.drop_view(name, database=database)
            except Exception:
                raise e
932967
public function drop()
        {
            $sql = $this->generateDropSql();
            try {
                $query = new RawQuery($sql);
                $statement = Statement::getPreparedStatement($query);
                return $statement->execute();
            } catch (\Exception $e) {
                throw new Exception('Error dropping table ' . $this->getB2DBName() . ': ' . $e->getMessage(), $sql);
            }
        }
830069
protected function dropDbTables()
    {
        // NOTE: This is optimized to avoid trying to delete tables over & over again.
        // If the app is network-wide and this is a network, there is only one set of tables.

        if ($this->App->Config->§specs['§is_network_wide'] && $this->Wp->is_multisite && $this->site_counter === 1) {
            $this->s::dropDbTables(); // Drop the network-wide tables for this app, just once.
            //
        } elseif (!$this->App->Config->§specs['§is_network_wide'] || !$this->Wp->is_multisite) {
            $this->s::dropDbTables(); // The table prefix changes for each site.
            // And, of course, this covers a standard WP installation also.
        }
    }
1228348
public function dropDatabase(): void
	{
		$tables = $this->getTables();
		if (!empty($tables)) {
			$this->connection->query('SET foreign_key_checks = 0');
			foreach ($tables as $table) {
				$this->connection->query('DROP TABLE %table', $table);
			}
			$this->connection->query('SET foreign_key_checks = 1');
		}
	}
1245551
protected void dropDatabase(String database)
  {

    log.debug("dropping possible existing database");
    closeAllConnections(database);
    getJdbcTemplate().execute("DROP DATABASE IF EXISTS " + database);

  }
976946
def drop_all(self):
        '''  '''
        self.drop(self.get_table_names())
        if self.persistent:
            with self._lock:
                try:
                    dbfolder = os.path.join(self.root_dir, self.name)
                    if os.path.exists(dbfolder) and not os.listdir(dbfolder):
                        rmtree(dbfolder)
                except (IOError, WindowsError):
                    self._print('Failed to delete folder %s when dropping database' % self.name)
                finally:
                    del self
177023
def drop_table(self, model, cascade=True):
        
        del self.orm[model._meta.table_name]
        self.ops.append(self.migrator.drop_table(model, cascade))
416571
def drop_all(self):
        """"""
        log.info('dropping tables in %s', self.engine.url)
        self.session.commit()
        models.Base.metadata.drop_all(self.engine)
        self.session.commit()
486601
final void closeAndRemoveAllDatabaseHandles() {
        for (Database databaseHandle : this.databaseHandles) {
            try {
                databaseHandle.close();
            } catch (EnvironmentFailureException | IllegalStateException ex) {
                LOGGER.log(Level.SEVERE,
                        "Error closing databases", ex);
            }
        }
        this.databaseHandles.clear();
    }
672478
protected function dropDatabase($database)
    {
        $connection = $this->pool->getConnection();
        $database = $database ?? $connection->defaultDatabase;

        $connection->getRawConnection()->dropDatabase($database);
    }
20727
def drop(self, force=False):
        
        self.client.drop_database(self.name, force=force)