Skip to content

Conversation

@nucccc
Copy link
Owner

@nucccc nucccc commented Dec 4, 2025

There was a bug in the code generated, in the sense that the attribute __table_args__ in a SQLModel class was set as a list, while instead the sqmodel library expected either a tuple or a dict.

That was used to define unique constraints.

With this PR that is not a list anymore, that is a tuple. Tests have been updated, and a test for the unique constraint now actually runs the generated code to ensure it works without errors.

@nucccc nucccc merged commit 91d7ab4 into main Dec 4, 2025
1 check passed
@nucccc nucccc deleted the fix/table_args_tuple branch December 4, 2025 20:11
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.

2 participants