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

Method _try_describe

xtop/core/data_source.py:114–124  ·  view source on GitHub ↗

Attempt to DESCRIBE the given glob pattern using the provided reader.

(self, conn, reader: str, pattern: str)

Source from the content-addressed store, hash-verified

112 return self.available_columns
113
114 def _try_describe(self, conn, reader: str, pattern: str):
115 """Attempt to DESCRIBE the given glob pattern using the provided reader."""
116 escaped = str(self.datadir / pattern).replace("'", "''")
117 try:
118 query = f"DESCRIBE SELECT * FROM {reader}('{escaped}') LIMIT 0"
119 result = conn.execute(query).fetchall()
120 if result:
121 return result
122 except Exception:
123 return None
124 return None
125
126 def get_schema_info(self) -> Dict[str, List[Tuple[str, str]]]:
127 """Return discovered schema information per CSV type."""

Callers 1

discover_columnsMethod · 0.95

Calls 2

fetchallMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected