Fix PostgreSQL DDL: use single-quoted DEFAULT literals.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -84,6 +84,7 @@ def adapt_sql(sql: str) -> str:
|
||||
flags=re.IGNORECASE,
|
||||
)
|
||||
out = re.sub(r"\bAUTOINCREMENT\b", "", out, flags=re.IGNORECASE)
|
||||
out = re.sub(r'DEFAULT\s+"([^"]*)"', r"DEFAULT '\1'", out, flags=re.IGNORECASE)
|
||||
if "?" in out:
|
||||
out = out.replace("?", "%s")
|
||||
return out
|
||||
|
||||
Reference in New Issue
Block a user