Skip to content

✨ Export SQLModelConfig and allow public ConfigDict for model_config - #2147

Closed
amargurung1013 wants to merge 1 commit into
fastapi:mainfrom
amargurung1013:fix-sqlmodelconfig-export
Closed

amargurung1013 wants to merge 1 commit into
fastapi:mainfrom
amargurung1013:fix-sqlmodelconfig-export

Conversation

@amargurung1013

Copy link
Copy Markdown

Summary

  • Exports SQLModelConfig publicly from sqlmodel and sqlmodel.main.
  • Updates model_config in SQLModelMetaclass to accept Any so type checkers (ty, pyright) allow Pydantic's standard ConfigDict and dictionary configurations.
  • Adds regression tests in tests/test_pydantic/test_model_config.py.

Motivation

Resolves discussion #2093: SQLModelConfig was previously not importable from the top-level package, causing type checkers to reject valid model configurations when using ConfigDict(from_attributes=True).

@YuriiMotov

Copy link
Copy Markdown
Member

@amargurung1013 thanks for your interest and efforts, but please follow the rules of the repository.

We ask people to only open PRs when it's explicitly requested by maintainers.
See https://tiangolo.com/open-source/contributing/ and PR description template:

Please start with a GitHub Discussion.

Once a team member asks you to open a PR, create it and link the discussion here.

I will close this for now to keep things clean.
Thanks for understanding!

@YuriiMotov YuriiMotov closed this Nov 30, 2026
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