MCPcopy
hub / github.com/tanelpoder/0xtools / connect

Method connect

xtop/core/data_source.py:38–45  ·  view source on GitHub ↗

Get or create DuckDB connection

(self)

Source from the content-addressed store, hash-verified

36 raise ValueError(f"Data directory does not exist: {datadir}")
37
38 def connect(self):
39 """Get or create DuckDB connection"""
40 if self.conn is None:
41 self.conn = duckdb.connect(':memory:')
42 # Configure thread count if specified
43 if self.duckdb_threads is not None:
44 self.conn.execute(f"SET threads TO {self.duckdb_threads}")
45 return self.conn
46
47 def close(self):
48 """Close DuckDB connection"""

Callers 11

discover_columnsMethod · 0.95
get_time_rangeMethod · 0.95
get_available_valuesMethod · 0.95
fetch_histogram_tableMethod · 0.80
executeMethod · 0.80
get_available_columnsMethod · 0.80
lookup_stack_traceMethod · 0.80
_describeMethod · 0.80

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected