Skip to content

Conversation

@sheinbergon
Copy link
Collaborator

Changes

Fixes #450

Add values_callable to allow for enum values to be inserted properly

Checklist

If this is a user-facing code change, like a bugfix or a new feature, please ensure that
you've fulfilled the following conditions (where applicable):

  • You've added tests (in tests/) which would fail without your patch
  • You've added a new changelog entry (in CHANGES.rst).

If this is a trivial change, like a typo fix or a code reformatting, then you can ignore
these instructions.

Updating the changelog

If there are no entries after the last release, use **UNRELEASED** as the version.
If, say, your patch fixes issue #123, the entry should look like this:

- Fix big bad boo-boo in task groups
  (`#123 <https://github.com/agronholm/sqlacodegen/issues/123>`_; PR by @yourgithubaccount)

If there's no issue linked, just link to your pull request instead by updating the
changelog after you've created the PR.

@coveralls
Copy link

coveralls commented Jan 23, 2026

Coverage Status

coverage: 97.459%. remained the same
when pulling c8a8b9f on sheinbergon:enum-generation-value-mapping
into f4619eb on agronholm:master.

@sheinbergon sheinbergon requested a review from agronholm January 23, 2026 09:46
@sheinbergon
Copy link
Collaborator Author

@agronholm please have a look at this small fix

@sheinbergon sheinbergon requested a review from agronholm January 23, 2026 12:44
Copy link
Owner

@agronholm agronholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering if it makes sense to add a test against the actual issue.

@sheinbergon
Copy link
Collaborator Author

Just wondering if it makes sense to add a test against the actual issue.

I'm not sure how you'd go about testing it with an actual database to the playing field. While I do think it's worth adding real E2E tests for this library , I feel it's an effort worthy of its own PR

@sheinbergon sheinbergon merged commit edb17ec into agronholm:master Jan 23, 2026
8 checks passed
@sheinbergon sheinbergon deleted the enum-generation-value-mapping branch January 23, 2026 13:27
@agronholm
Copy link
Owner

Just wondering if it makes sense to add a test against the actual issue.

I'm not sure how you'd go about testing it with an actual database to the playing field. While I do think it's worth adding real E2E tests for this library , I feel it's an effort worthy of its own PR

Using an SQLite database to add a record involving an enum would suffice I think.

@sheinbergon
Copy link
Collaborator Author

Just wondering if it makes sense to add a test against the actual issue.

I'm not sure how you'd go about testing it with an actual database to the playing field. While I do think it's worth adding real E2E tests for this library , I feel it's an effort worthy of its own PR

Using an SQLite database to add a record involving an enum would suffice I think.

So that's a real database, nonetheless. Setting any database is not an issue. Building E2E test infrastructure is a bit of a bigger task I'd like to properly design at some point. We'll get there

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.

Issue with generated enums not being insertable

3 participants