Add README, fix column deduplication in parser, remove .env from git
This commit is contained in:
@@ -63,9 +63,13 @@ def _extract_table(statement: exp.Select) -> str:
|
||||
|
||||
|
||||
def _extract_columns(statement: exp.Select) -> list[str]:
|
||||
columns = []
|
||||
seen: set[str] = set()
|
||||
columns: list[str] = []
|
||||
for col in statement.find_all(exp.Column):
|
||||
columns.append(col.name)
|
||||
name = col.name
|
||||
if name not in seen:
|
||||
seen.add(name)
|
||||
columns.append(name)
|
||||
if not columns:
|
||||
raise UnsupportedQueryError("Could not extract column names from query.")
|
||||
return columns
|
||||
|
||||
Reference in New Issue
Block a user