def get_prefixes() -> Iterator[PrefixMetaData]
Discovers and returns all available prefixes from the configured dbzero root location.
This function scans the environment for existing files and is typically used during application startup to identify and open all available prefixes, making the data accessible.
Returns
An iterator over metadata objects for each discovered prefix. Each object has a .name attribute holding the string identifier of the prefix and an .uuid.
Example
Discovering and opening all available prefixes
A common use case is to iterate through the discovered prefixes to open each one, for example, in read-only mode.
# First, initialize the dbzero environment
db0.init(path="/path/to/my/data")
# Discover all available prefixes
all_prefixes = list(db0.get_prefixes())
print(f"Discovered {len(all_prefixes)} prefixes.")
# Iterate and open each one
for prefix in all_prefixes:
print(f"Opening prefix: {prefix.name}")
db0.open(prefix.name, "r")
# Now all prefixes are open and their data can be queried.