linkml_store.api.stores.filesystem.filesystem_database module

class FileSystemDatabase(handle=None, **kwargs)[source]

Bases: Database

collection_class

alias of FileSystemCollection

default_file_format: Optional[str] = None
no_backup_on_drop: bool = False
__init__(handle=None, **kwargs)[source]
directory_path: Optional[Path] = None
property metadata_path: Path
load_metadata()[source]
close(**kwargs)[source]

Close the database.

Parameters:

kwargs

Returns:

drop(no_backup=False, **kwargs)[source]

Drop the database and all collections.

>>> from linkml_store.api.client import Client
>>> client = Client()
>>> path = Path("/tmp/test.db")
>>> path.parent.mkdir(exist_ok=True, parents=True)
>>> db = client.attach_database(f"duckdb:///{path}")
>>> db.store({"persons": [{"id": "P1", "name": "John", "age_in_years": 30}]})
>>> coll = db.get_collection("persons")
>>> coll.find({}).num_rows
1
>>> db.drop()
>>> db = client.attach_database("duckdb:///tmp/test.db", alias="test")
>>> coll = db.get_collection("persons")
>>> coll.find({}).num_rows
0
Parameters:

kwargs – additional arguments

init_collections()[source]

Initialize collections.

TODO: Not typically called directly: consider making this private :return:

xxxinduce_schema_view()[source]
Return type:

SchemaView