René's URL Explorer Experiment


Title: could not assemble any primary key columns for mapped table · Issue #1606 · fastapi/sqlmodel · GitHub

Open Graph Title: could not assemble any primary key columns for mapped table · Issue #1606 · fastapi/sqlmodel

X Title: could not assemble any primary key columns for mapped table · Issue #1606 · fastapi/sqlmodel

Description: Privileged issue I'm @tiangolo or he asked me directly to create an issue here. Issue Content File "C:\Users\petzold\PycharmProjects\script_executor\model\exec_result.py", line 9, in class ExecResult(SQLModel, table=True): ...<8...

Open Graph Description: Privileged issue I'm @tiangolo or he asked me directly to create an issue here. Issue Content File "C:\Users\petzold\PycharmProjects\script_executor\model\exec_result.py", line 9, in class...

X Description: Privileged issue I'm @tiangolo or he asked me directly to create an issue here. Issue Content File "C:\Users\petzold\PycharmProjects\script_executor\model\exec_result.py", line 9, in ...

Opengraph URL: https://github.com/fastapi/sqlmodel/issues/1606

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"could not assemble any primary key columns for mapped table","articleBody":"### Privileged issue\n\n- [x] I'm @tiangolo or he asked me directly to create an issue here.\n\n### Issue Content\n```\n File \"C:\\Users\\petzold\\PycharmProjects\\script_executor\\model\\exec_result.py\", line 9, in \u003cmodule\u003e\n    class ExecResult(SQLModel, table=True):\n    ...\u003c8 lines\u003e...\n        update_time: Annotated[datetime, Field(sa_column=Column('update_time', DateTime, default=func.now(), onupdate=func.now()), description='更新时间'), PlainSerializer(lambda x: x.strftime('%Y-%m-%d %H:%M:%S'), return_type=str)]\n  File \"C:\\Users\\petzold\\PycharmProjects\\script_executor\\.venv\\Lib\\site-packages\\sqlmodel\\main.py\", line 644, in __init__\n    DeclarativeMeta.__init__(cls, classname, bases, dict_, **kw)\n    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"C:\\Users\\petzold\\PycharmProjects\\script_executor\\.venv\\Lib\\site-packages\\sqlalchemy\\orm\\decl_api.py\", line 199, in __init__\n    _as_declarative(reg, cls, dict_)\n    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^\n  File \"C:\\Users\\petzold\\PycharmProjects\\script_executor\\.venv\\Lib\\site-packages\\sqlalchemy\\orm\\decl_base.py\", line 245, in _as_declarative\n    return _MapperConfig.setup_mapping(registry, cls, dict_, None, {})\n           ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"C:\\Users\\petzold\\PycharmProjects\\script_executor\\.venv\\Lib\\site-packages\\sqlalchemy\\orm\\decl_base.py\", line 326, in setup_mapping\n    return _ClassScanMapperConfig(\n        registry, cls_, dict_, table, mapper_kw\n    )\n  File \"C:\\Users\\petzold\\PycharmProjects\\script_executor\\.venv\\Lib\\site-packages\\sqlalchemy\\orm\\decl_base.py\", line 581, in __init__\n    self._early_mapping(mapper_kw)\n    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^\n  File \"C:\\Users\\petzold\\PycharmProjects\\script_executor\\.venv\\Lib\\site-packages\\sqlalchemy\\orm\\decl_base.py\", line 367, in _early_mapping\n    self.map(mapper_kw)\n    ~~~~~~~~^^^^^^^^^^^\n  File \"C:\\Users\\petzold\\PycharmProjects\\script_executor\\.venv\\Lib\\site-packages\\sqlalchemy\\orm\\decl_base.py\", line 1995, in map\n    mapper_cls(self.cls, self.local_table, **self.mapper_args),\n    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"\u003cstring\u003e\", line 2, in __init__\n  File \"C:\\Users\\petzold\\PycharmProjects\\script_executor\\.venv\\Lib\\site-packages\\sqlalchemy\\util\\deprecations.py\", line 281, in warned\n    return fn(*args, **kwargs)  # type: ignore[no-any-return]\n  File \"C:\\Users\\petzold\\PycharmProjects\\script_executor\\.venv\\Lib\\site-packages\\sqlalchemy\\orm\\mapper.py\", line 866, in __init__\n    self._configure_pks()\n    ~~~~~~~~~~~~~~~~~~~^^\n  File \"C:\\Users\\petzold\\PycharmProjects\\script_executor\\.venv\\Lib\\site-packages\\sqlalchemy\\orm\\mapper.py\", line 1652, in _configure_pks\n    raise sa_exc.ArgumentError(\n    ...\u003c3 lines\u003e...\n    )\nsqlalchemy.exc.ArgumentError: Mapper Mapper[ExecResult(exec_result)] could not assemble any primary key columns for mapped table 'exec_result'\n```\nmy model is \n```python\nclass ExecResult(SQLModel, table=True):\n    \"\"\"执行结果\"\"\"\n    __tablename__ = 'exec_result'\n    id: Annotated[int, Field(sa_column=Column('id', primary_key=True), description=\"id\")]\n    script_id: Annotated[int, Field(description=\"脚本id\")]\n    status: Annotated[int, Field(description=\"执行状态\")]\n    result: Annotated[str, Field(description=\"执行结果\")]\n    error: Annotated[str, Field(description=\"错误输出\")]\n    create_time: Annotated[datetime, Field(sa_column=Column('create_time', DateTime, default=func.now()), description='创建时间'), PlainSerializer(lambda x: x.strftime('%Y-%m-%d %H:%M:%S'), return_type=str)]\n    update_time: Annotated[datetime, Field(sa_column=Column('update_time', DateTime, default=func.now(), onupdate=func.now()), description='更新时间'), PlainSerializer(lambda x: x.strftime('%Y-%m-%d %H:%M:%S'), return_type=str)]\n```\n\nthis is also not work\n```python\nclass ExecResult(SQLModel, table=True):\n    \"\"\"执行结果\"\"\"\n    __tablename__ = 'exec_result'\n    id: Annotated[int, Field(primary_key=True, description=\"id\")]\n    script_id: Annotated[int, Field(description=\"脚本id\")]\n    status: Annotated[int, Field(description=\"执行状态\")]\n    result: Annotated[str, Field(description=\"执行结果\")]\n    error: Annotated[str, Field(description=\"错误输出\")]\n    create_time: Annotated[datetime, Field(sa_column=Column('create_time', DateTime, default=func.now()), description='创建时间'), PlainSerializer(lambda x: x.strftime('%Y-%m-%d %H:%M:%S'), return_type=str)]\n    update_time: Annotated[datetime, Field(sa_column=Column('update_time', DateTime, default=func.now(), onupdate=func.now()), description='更新时间'), PlainSerializer(lambda x: x.strftime('%Y-%m-%d %H:%M:%S'), return_type=str)]\n```\n","author":{"url":"https://github.com/cjdxhjj","@type":"Person","name":"cjdxhjj"},"datePublished":"2025-10-14T01:28:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/1606/sqlmodel/issues/1606"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:04c60fb1-f1dc-ef6d-298f-64182acb1c03
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC970:12D058:45A531:5CDC56:6A629778
html-safe-nonce29fbb1308f332a21e36d8bf3e7b15ce1f1664f5936b764285f2507f583a9c3b6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTcwOjEyRDA1ODo0NUE1MzE6NUNEQzU2OjZBNjI5Nzc4IiwidmlzaXRvcl9pZCI6Ijg1NTE3MjA1MDg4MTU3NDI4NDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac1278c486f40f37e7119f4ba5c4d15b659504bf91ebd384bfe2868622ea5dd38f
hovercard-subject-tagissue:3512018925
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/fastapi/sqlmodel/1606/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7981fb117ab7e99132d71656cadeef54ce7a052ab3c2578842a11e026aca74d3/fastapi/sqlmodel/issues/1606
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7981fb117ab7e99132d71656cadeef54ce7a052ab3c2578842a11e026aca74d3/fastapi/sqlmodel/issues/1606
og:image:altPrivileged issue I'm @tiangolo or he asked me directly to create an issue here. Issue Content File "C:\Users\petzold\PycharmProjects\script_executor\model\exec_result.py", line 9, in class...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamecjdxhjj
hostnamegithub.com
expected-hostnamegithub.com
None10ffaff7e212112a3b4eeb224665f909dff951514db9af4f00de33b681024427
turbo-cache-controlno-preview
go-importgithub.com/fastapi/sqlmodel git https://github.com/fastapi/sqlmodel.git
octolytics-dimension-user_id156354296
octolytics-dimension-user_loginfastapi
octolytics-dimension-repository_id399495186
octolytics-dimension-repository_nwofastapi/sqlmodel
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id399495186
octolytics-dimension-repository_network_root_nwofastapi/sqlmodel
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee470e2fc66e1ac7f528caec0fd8825047788d563
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/fastapi/sqlmodel/issues/1606#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffastapi%2Fsqlmodel%2Fissues%2F1606
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffastapi%2Fsqlmodel%2Fissues%2F1606
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=fastapi%2Fsqlmodel
Reloadhttps://github.com/fastapi/sqlmodel/issues/1606
Reloadhttps://github.com/fastapi/sqlmodel/issues/1606
Reloadhttps://github.com/fastapi/sqlmodel/issues/1606
Please reload this pagehttps://github.com/fastapi/sqlmodel/issues/1606
fastapi https://github.com/fastapi
sqlmodelhttps://github.com/fastapi/sqlmodel
Please reload this pagehttps://github.com/fastapi/sqlmodel/issues/1606
Notifications https://github.com/login?return_to=%2Ffastapi%2Fsqlmodel
Fork 874 https://github.com/login?return_to=%2Ffastapi%2Fsqlmodel
Star 18.2k https://github.com/login?return_to=%2Ffastapi%2Fsqlmodel
Code https://github.com/fastapi/sqlmodel
Issues 1 https://github.com/fastapi/sqlmodel/issues
Pull requests 57 https://github.com/fastapi/sqlmodel/pulls
Discussions https://github.com/fastapi/sqlmodel/discussions
Actions https://github.com/fastapi/sqlmodel/actions
Projects https://github.com/fastapi/sqlmodel/projects
Security and quality 0 https://github.com/fastapi/sqlmodel/security
Insights https://github.com/fastapi/sqlmodel/pulse
Code https://github.com/fastapi/sqlmodel
Issues https://github.com/fastapi/sqlmodel/issues
Pull requests https://github.com/fastapi/sqlmodel/pulls
Discussions https://github.com/fastapi/sqlmodel/discussions
Actions https://github.com/fastapi/sqlmodel/actions
Projects https://github.com/fastapi/sqlmodel/projects
Security and quality https://github.com/fastapi/sqlmodel/security
Insights https://github.com/fastapi/sqlmodel/pulse
#1623https://github.com/fastapi/sqlmodel/issues/1623
#1623https://github.com/fastapi/sqlmodel/issues/1623
could not assemble any primary key columns for mapped tablehttps://github.com/fastapi/sqlmodel/issues/1606#top
https://github.com/cjdxhjj
cjdxhjjhttps://github.com/cjdxhjj
on Oct 14, 2025https://github.com/fastapi/sqlmodel/issues/1606#issue-3512018925
@tiangolohttps://github.com/tiangolo
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.