https://www.w3.org/TR/webdatabase/#databases > There is no way to enumerate or delete the databases available for an origin from this API.
346780
function getAllStoreNames(db) {
    return new Promise$1(function (resolve, reject) {
        db.transaction(function (t) {
            t.executeSql('SELECT name FROM sqlite_master ' + "WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'", [], function (t, results) {
                var storeNames = [];

                for (var i = 0; i < results.rows.length; i++) {
                    storeNames.push(results.rows.item(i).name);
                }

                resolve({
                    db: db,
                    storeNames: storeNames
                });
            }, function (t, error) {
                reject(error);
            });
        }, function (sqlError) {
            reject(sqlError);
        });
    });
}
330974
function dropEnvironmentDatabase(domain, env, next) {
  _getEnvironmentDatabase({
    domain: domain,
    environment: env
  }, function (err, found) {
    if (err) {
      return next(common.buildErrorObject({
        err: err,
        msg: 'Failed to get environment',
        httpCode: 500
      }));
    }
    if (!found) {
      log.logger.info("no environment db for " + env + " moving on");
      return next();
    }
    found.dropDb(config.getConfig(), function dropped(err) {
      if (err) {
        log.logger.error('Failed to delete model');
        return next(common.buildErrorObject({
          err: err,
          msg: 'Failed to drop environment db',
          httpCode: 500
        }));
      }
      found.remove(next);
    });
  });
}
840051
def delete_collection(db_name, collection_name, host='localhost', port=27017):
    """"""
    client = MongoClient("mongodb://%s:%d" % (host, port))
    client[db_name].drop_collection(collection_name)
1314830
def _get_collections(self, db_names=None):
        
        if db_names:
            db_list = db_names
        else:
            db_list = self.client.list_database_names()

        for db_name in db_list:
            db = self.client.get_database(db_name)
            for col_name in db.list_collection_names():
                size = db[col_name].g
                yield f"{db_name}.{col_name}"
1338497
function initDB () {
  return db.listDatabases()
    .then(response => {
      if (response.data.indexOf(dbName) !== -1) {
        // database already exists
        return Promise.resolve('ok')
      } else {
        // create new database
        return db.createDatabase(dbName).then(() => 'ok')
      }
    })
}
518936
@Override
	public HsqlDatabaseDescriptor dbByName(final String dbName) {
		Collection<HsqlDatabaseDescriptor> select = CollectionUtils.select(dbs,
				new Predicate<HsqlDatabaseDescriptor>() {

					@Override
					public boolean evaluate(HsqlDatabaseDescriptor db) {
						return dbName.equals(db.getDbName());
					}

				});
		if (CollectionUtils.size(select) == 0) {
			throw new IllegalArgumentException(
					"There are no databases called '" + dbName + "'");
		}
		if (CollectionUtils.size(select) >= 2) {
			throw new IllegalArgumentException(
					"More than one database is called '" + dbName + "'");
		}
		return CollectionUtils.extractSingleton(select);
	}
542462
function destroyDatabase(name, cb) {
  if(name === user_dbname)
    throw new Error('We never ever delete that database.')
  nano().db.destroy(name, function(err) {
    if(err && err.status_code !== 404) return cb(err)
    cb(null, err ? false : true)
  })
}
207149
def revoke_user_access(self, user, db_names, strict=True):
        
        user = utils.get_name(user)
        db_names = self._get_db_names(db_names, strict=strict)
        bad_names = []
        for db_name in db_names:
            uri = "/%s/%s/databases/%s" % (self.uri_base, user, db_name)
            resp, resp_body = self.api.method_delete(uri)
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()
183659
@Override
  public final void deleteDatabase(final String pDbName) throws Exception {
    String dbNm = this.databasePrefix + pDbName + ".sqlite";
    if (!dbNm.equals(this.factoryAppBeans.getDatabaseName())) {
      File dbFile = new File(this.databaseDir + File.separator + dbNm);
      if (dbFile.exists() && !dbFile.delete()) {
        throw new ExceptionWithCode(ExceptionWithCode.SOMETHING_WRONG,
          "Can't delete file: " + dbFile);
      }
    }
  }
1097434
function dumpDatabase(db, allzones) {
  var sources = db.getSources();
  for (var n = 0; n < sources.length; n++) {
    util.logContextInfo(sources[n].getContextInfo());
  }

  var zones = db.getZones();
  if (!zones.length) {
    console.log('No zones');
    return 0;
  }

  var count = allzones ? zones.length : 1;
  for (var i = 0; i < count; ++i) {
    var zone = zones[i];
    var eventList = zone.getEventList();
    var it = eventList.begin();
    for (; !it.done(); it.next()) {
      util.logEvent(it, zone);
    }

  }
  return 0;
}
1275325
def drop_db(name, **client_args):
    '''
    
    '''
    if not db_exists(name, **client_args):
        log.info('DB \'%s\' does not exist', name)
        return False

    client = _client(**client_args)
    client.drop_database(name)

    return True
1123279
public void blankExistingTables() {
        Connection connection = null;
        Statement s = null;
        try {
            connection = SQLUtility.getDefaultConnection(m_serverConfig);
            List<String> existingTables = getExistingTables(connection);
            List<String> fedoraTables = getFedoraTables();
            s = connection.createStatement();
            for (String origTableName: existingTables) {
                String tableName = origTableName.toUpperCase();
                if (fedoraTables.contains(tableName)
                        && !tableName.startsWith("RI")) {
                    System.out.println("Cleaning up table: " + origTableName);
                    try {
                        s.executeUpdate("DELETE FROM " + origTableName);
                    } catch (Exception lle) {
                        System.err.println(lle.getMessage());
                        System.err.flush();
                    }
                }
            }
        } catch (SQLException e) {
            throw new RuntimeException("DB error while blanking existing tables",
                                       e);
        } finally {
            try {
            	if (s != null) {
            		s.close();
            		s = null;
            	}
                connection.close();
            } catch (Exception e) {
            }
        }
    }
1047608
@DELETE
    @RequiresPermissions(I18nPermissions.LOCALE_DELETE)
    public Response deleteAllAvailableLocales() {
        List<Locale> locales = localeRepository.loadAll();
        for (Locale locale : locales) {
            localeRepository.remove(locale);
        }
        return Response.noContent().build();

    }
955538
public void free()
    {
        this.setPDatabaseParent(null); // Remove from database
        
        Object[] keys = m_htTableList.keySet().toArray();
        for (int i = 0; i < keys.length; i++)
        { 
            Object key = keys[i];
            PTable pTable = m_htTableList.get(key);
            if (pTable != null)
                pTable.free();      // This can be dangerous if the PhysicalTables still have references to the PTables
        } 
        m_htTableList.clear();
        m_htTableList = null;
        this.close();
    }
116029
@InterfaceAudience.Private
    private void replaceDatabase(String databaseName,
                                 InputStream databaseStream,
                                 Iterator<Map.Entry<String, InputStream>> attachmentStreams)
            throws CouchbaseLiteException {
        try {
            Database db = getDatabase(databaseName, false);

            String dstDbPath = FileDirUtils.getPathWithoutExt(db.getPath()) + kV1DBExtension;
            String dstAttsPath = FileDirUtils.getPathWithoutExt(dstDbPath) + " attachments";

            OutputStream destStream = new FileOutputStream(new File(dstDbPath));
            StreamUtils.copyStream(databaseStream, destStream);
            File attachmentsFile = new File(dstAttsPath);
            FileDirUtils.deleteRecursive(attachmentsFile);
            if (!attachmentsFile.exists()) {
                attachmentsFile.mkdirs();
            }
            if (attachmentStreams != null) {
                StreamUtils.copyStreamsToFolder(attachmentStreams, attachmentsFile);
            }
            if (!upgradeV1Database(databaseName, dstDbPath)) {
                throw new CouchbaseLiteException(Status.INTERNAL_SERVER_ERROR);
            }
            db.open();
            db.replaceUUIDs();
        } catch (FileNotFoundException e) {
            Log.e(Database.TAG, "Error replacing the database: %s", e, databaseName);
            throw new CouchbaseLiteException(Status.INTERNAL_SERVER_ERROR);
        } catch (IOException e) {
            Log.e(Database.TAG, "Error replacing the database: %s", e, databaseName);
            throw new CouchbaseLiteException(Status.INTERNAL_SERVER_ERROR);
        }
    }
1003072
def destroy():
    """"""
    if not os.path.exists(ARGS.database):
        exit('Error: The database does not exist; you must create it first.')
    if ARGS.force:
        os.remove(ARGS.database)
    elif raw_input('Destroy {0} [y/n]? '.format(ARGS.database)) in ('y', 'Y'):
        os.remove(ARGS.database)