Skip to content

Instantly share code, notes, and snippets.

@eyaltrabelsi
Created May 3, 2024 19:44
Show Gist options
  • Save eyaltrabelsi/b6fb0c5642f93dd8a985019950dda45b to your computer and use it in GitHub Desktop.
Save eyaltrabelsi/b6fb0c5642f93dd8a985019950dda45b to your computer and use it in GitHub Desktop.
def test_queries_synatx():
queries = glob.glob('**/*.sql',recursive=True)
engine = create_engine('<COOL_CONNECTION_STR>')
with engine.connect() as con:
for query_file in queries_list:
with open(query_file) as f:
query = f.read()
test_query = f"Explain {query}"
con.execute(test_query)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment