MCPcopy
hub / github.com/StructuredLabs/preswald / connect

Function connect

preswald/interfaces/data.py:12–23  ·  view source on GitHub ↗

Connect to all listed data sources in preswald.toml

()

Source from the content-addressed store, hash-verified

10
11
12def connect():
13 """
14 Connect to all listed data sources in preswald.toml
15 """
16 try:
17 service = PreswaldService.get_instance()
18 source_names, duckdb_conn = service.data_manager.connect()
19 logger.info(f"Successfully connected to data sources: {source_names}")
20 # TODO: bug - getting duplicated if there are multiple clients
21 return duckdb_conn
22 except Exception as e:
23 logger.error(f"Error connecting to datasources: {e}")
24
25
26def query(sql: str, source_name: str) -> pd.DataFrame:

Callers 1

hello.pyFile · 0.90

Calls 2

get_instanceMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected