MCPcopy Create free account
hub / github.com/awslabs/gap-text2sql / isValidSQL

Function isValidSQL

rat-sql-gap/seq2struct/datasets/spider_lib/evaluation.py:561–568  ·  view source on GitHub ↗
(sql, db)

Source from the content-addressed store, hash-verified

559
560
561def isValidSQL(sql, db):
562 conn = sqlite3.connect(db)
563 cursor = conn.cursor()
564 try:
565 cursor.execute(sql)
566 except:
567 return False
568 return True
569
570
571def print_scores(scores, etype):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected