MCPcopy Index your code
hub / github.com/treeverse/dvc / client

Function client

dvc/database.py:121–134  ·  view source on GitHub ↗
(
    url_or_config: Union[str, "URL", dict[str, str]], **engine_kwargs: Any
)

Source from the content-addressed store, hash-verified

119
120@contextmanager
121def client(
122 url_or_config: Union[str, "URL", dict[str, str]], **engine_kwargs: Any
123) -> Iterator[Client]:
124 url = url_from_config(url_or_config)
125 echo = env2bool(env.DVC_SQLALCHEMY_ECHO, False)
126 engine_kwargs.setdefault("echo", echo)
127
128 with handle_error(url):
129 engine = create_engine(url, **engine_kwargs)
130
131 try:
132 yield Client(engine)
133 finally:
134 engine.dispose()

Callers 2

runMethod · 0.90
downloadMethod · 0.90

Calls 4

env2boolFunction · 0.90
url_from_configFunction · 0.85
ClientClass · 0.85
handle_errorFunction · 0.70

Tested by

no test coverage detected