MCPcopy Create free account
hub / github.com/IQEngine/IQEngine / get

Function get

api/database/datasource_repo.py:17–39  ·  view source on GitHub ↗

Get a datasource by account and container Parameters ---------- account : str The account name. container : str The container name. Returns ------- DataSource The datasource.

(account, container)

Source from the content-addressed store, hash-verified

15
16
17async def get(account, container) -> DataSource | None:
18 """
19 Get a datasource by account and container
20
21 Parameters
22 ----------
23 account : str
24 The account name.
25 container : str
26 The container name.
27
28 Returns
29 -------
30 DataSource
31 The datasource.
32 """
33 datasource_collection: AgnosticCollection = collection()
34 datasource = await datasource_collection.find_one(
35 {"account": account, "container": container}
36 )
37 if datasource is None:
38 return None
39 return DataSource(**datasource)
40
41
42async def datasource_exists(account, container) -> bool:

Callers 2

datasource_existsFunction · 0.70
syncFunction · 0.70

Calls 2

DataSourceClass · 0.90
collectionFunction · 0.70

Tested by

no test coverage detected