Fix PostgreSQL DDL: use single-quoted DEFAULT literals.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-01 08:12:34 +08:00
parent 52aca456e9
commit 1b276b5897
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -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