MCPcopy Create free account
hub / github.com/IBM/AssetOpsBench / reset

Function reset

src/couchdb/init_data.py:111–123  ·  view source on GitHub ↗

Drop databases for a clean state. Returns the dropped names. Default: drop every user database (CouchDB GET /_all_dbs, system DBs excluded). ``managed_only=True`` drops only the default-manifest collections.

(managed_only: bool = False)

Source from the content-addressed store, hash-verified

109
110
111def reset(managed_only: bool = False) -> list:
112 """Drop databases for a clean state. Returns the dropped names.
113
114 Default: drop every user database (CouchDB GET /_all_dbs, system DBs excluded).
115 ``managed_only=True`` drops only the default-manifest collections.
116 """
117 targets = all_databases() if managed_only else loader.list_databases()
118 dropped = []
119 for db in targets:
120 code = loader.drop_database(db)
121 logger.info("Dropped database '%s' (%s).", db, code)
122 dropped.append(db)
123 return dropped
124
125
126# --------------------------------------------------------------------------- #

Callers 2

init_dataFunction · 0.85
mainFunction · 0.85

Calls 1

all_databasesFunction · 0.85

Tested by

no test coverage detected