Skip to content

fix: MySQL parameter binding compatibility with SQLAlchemy #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

santinalbrowns
Copy link

  • Convert MySQL '?' placeholders to named parameters (':p1', ':p2', etc.) for proper SQLAlchemy parameter binding
  • Add MySQL type mapping support for Python type inference
  • Fix SQL syntax error when using generated code with MySQL + SQLAlchemy

The generated code was using '?' placeholders in SQL but passing named parameters as dictionaries, which caused MySQL syntax errors. This fix ensures the SQL uses named parameters that match the parameter binding.

Fixes parameter binding issues for MySQL users of sqlc-gen-python.

- Convert MySQL '?' placeholders to named parameters (':p1', ':p2', etc.)
  for proper SQLAlchemy parameter binding
- Add MySQL type mapping support for Python type inference
- Fix SQL syntax error when using generated code with MySQL + SQLAlchemy

The generated code was using '?' placeholders in SQL but passing named
parameters as dictionaries, which caused MySQL syntax errors. This fix
ensures the SQL uses named parameters that match the parameter binding.

Fixes parameter binding issues for MySQL users of sqlc-gen-python.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant