Skip to content
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

Python reserved words #1241

Closed
Hendler opened this issue Oct 19, 2021 · 1 comment
Closed

Python reserved words #1241

Hendler opened this issue Oct 19, 2021 · 1 comment
Labels
📚 mysql bug Something isn't working 💻 darwin 🔧 python Pull requests that update Python code

Comments

@Hendler
Copy link

Hendler commented Oct 19, 2021

Version

1.10.0

What happened?

Python output looks good!

Minor issue.

I had a column name named class. This generated a python dataclass that did not escape the reserved word. Not sure if the solution is to

  • not name things "class" (my workaround)
  • quote class in the dataclass (like type hinting can do in python)
  • warn user and reject reserved words as column names/dataclass field names

(I have seen this in mysql with type as column name too.)

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

No response

Playground URL

No response

What operating system are you using?

macOS

What database engines are you using?

MySQL

What type of code are you generating?

Python

@Hendler Hendler added bug Something isn't working triage New issues that hasn't been reviewed labels Oct 19, 2021
@kyleconroy kyleconroy added 🔧 python Pull requests that update Python code and removed triage New issues that hasn't been reviewed labels Nov 1, 2021
@kyleconroy
Copy link
Collaborator

Migrated to sqlc-dev/sqlc-gen-python#2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 mysql bug Something isn't working 💻 darwin 🔧 python Pull requests that update Python code
Projects
None yet
Development

No branches or pull requests

2 participants