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

Support MappedColumn for sa_column #1143

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

spazm
Copy link

@spazm spazm commented Oct 21, 2024

Reopening PR #896.

id: Optional[int] = Field(default=None, sa_column=mapped_column('id', Integer, primary_key=True))

This PR adds a test with sqlmodel.orm.mapped_column working for sa_column. This test fails on current main.

from typing import Optional
from sqlalchemy import Integer
from sqlalchemy.orm import mapped_column
from sqlmodel import Field

class Foo(SqlModel):
    id: Optional[int] = Field(default=None, sa_column=mapped_column('id', Integer, primary_key=True))

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