René's URL Explorer Experiment


Title: 📝 Add code example for `sa_column` `onupdate` timestamps by RobertRosca · Pull Request #372 · fastapi/sqlmodel · GitHub

Open Graph Title: 📝 Add code example for `sa_column` `onupdate` timestamps by RobertRosca · Pull Request #372 · fastapi/sqlmodel

X Title: 📝 Add code example for `sa_column` `onupdate` timestamps by RobertRosca · Pull Request #372 · fastapi/sqlmodel

Description: Issue #370 is a common usecase and there have been a few other questions about how to implement created_at or updated_at timestamps in rows. This PR adds examples to the advanced section of the documentation on how this can be done with sa_columns, and also links the relevant sections of Pydantic documentation which show how to use factories or validators to achieve a similar thing with Pydantic.

Open Graph Description: Issue #370 is a common usecase and there have been a few other questions about how to implement created_at or updated_at timestamps in rows. This PR adds examples to the advanced section of the doc...

X Description: Issue #370 is a common usecase and there have been a few other questions about how to implement created_at or updated_at timestamps in rows. This PR adds examples to the advanced section of the doc...

Opengraph URL: https://github.com/fastapi/sqlmodel/pull/372

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:900b6f02-0a2f-f6a5-d853-4118c23244a5
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCF4A:119A4:609AE9:7EDEFA:6AFE6C2B
html-safe-nonce8d86a05d8107368e701ccfbe9fe8cb40905a33812dec39581f840b96b001a02d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjRBOjExOUE0OjYwOUFFOTo3RURFRkE6NkFGRTZDMkIiLCJ2aXNpdG9yX2lkIjoiNzg5NzUwODk1ODk3MTExNTk1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac56e6dc6681fc741755cf4ff74594423395f7c8e414c8fcd1455d41910b0ae9e7
hovercard-subject-tagpull_request:984298516
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/fastapi/sqlmodel/pull/372/files
twitter:imagehttps://avatars.githubusercontent.com/u/32569096?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/32569096?s=400&v=4
og:image:altIssue #370 is a common usecase and there have been a few other questions about how to implement created_at or updated_at timestamps in rows. This PR adds examples to the advanced section of the doc...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4a10310af51a1bfffbedc4fd81cb582acf0cb0ff
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/fastapi/sqlmodel/pull/372/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffastapi%2Fsqlmodel%2Fpull%2F372%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffastapi%2Fsqlmodel%2Fpull%2F372%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=fastapi%2Fsqlmodel
Reloadhttps://github.com/fastapi/sqlmodel/pull/372/files
Reloadhttps://github.com/fastapi/sqlmodel/pull/372/files
Reloadhttps://github.com/fastapi/sqlmodel/pull/372/files
fastapihttps://github.com/fastapi
sqlmodelhttps://github.com/fastapi/sqlmodel
Codehttps://github.com/fastapi/sqlmodel
Issues1 (1)https://github.com/fastapi/sqlmodel/issues
Pull requests53 (53)https://github.com/fastapi/sqlmodel/pulls
Discussionshttps://github.com/fastapi/sqlmodel/discussions
Actionshttps://github.com/fastapi/sqlmodel/actions
Projectshttps://github.com/fastapi/sqlmodel/projects
Security and qualityhttps://github.com/fastapi/sqlmodel/security
Insightshttps://github.com/fastapi/sqlmodel/insights
Sign up for GitHub https://github.com/signup?return_to=%2Ffastapi%2Fsqlmodel%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Ffastapi%2Fsqlmodel%2Fissues%2Fnew%2Fchoose
RobertRoscahttps://github.com/RobertRosca
fastapi:mainhttps://github.com/fastapi/sqlmodel/tree/main
RobertRosca:docs/created_updated_at_colshttps://github.com/RobertRosca/sqlmodel/tree/docs/created_updated_at_cols
Conversation 23 https://github.com/fastapi/sqlmodel/pull/372
Commits 7 https://github.com/fastapi/sqlmodel/pull/372/commits
Checks 0 https://github.com/fastapi/sqlmodel/pull/372/checks
Files changed https://github.com/fastapi/sqlmodel/pull/372/files
Please reload this pagehttps://github.com/fastapi/sqlmodel/pull/372/files
📝 Add code example for sa_column onupdate timestamps https://github.com/fastapi/sqlmodel/pull/372/files#top
Show all changes 7 commits https://github.com/fastapi/sqlmodel/pull/372/files
893bcf3 Add example code for sa_column onupdate timestamps RobertRosca Jun 30, 2022 https://github.com/fastapi/sqlmodel/pull/372/commits/893bcf3d71c493077ad2306c184e9ccf4c8aa7c7
1e5caaa Fix import order RobertRosca Sep 18, 2022 https://github.com/fastapi/sqlmodel/pull/372/commits/1e5caaaf02b46f50f48ff5141f4f7980e36387e2
01ca385 Fix typo RobertRosca Nov 2, 2022 https://github.com/fastapi/sqlmodel/pull/372/commits/01ca385558e50ea23c6fa3961e87cd1fdb92abc8
d78fc71 Add notes on Pydantic implementation of updated_at RobertRosca Nov 2, 2022 https://github.com/fastapi/sqlmodel/pull/372/commits/d78fc7116a241ef9aef41ab7d927192ff3e48df9
b160fc8 Merge branch 'main' into docs/created_updated_at_cols tiangolo Dec 16, 2022 https://github.com/fastapi/sqlmodel/pull/372/commits/b160fc8a163a37e7201adef2af1e6f22539d68e8
06e0471 Merge branch 'main' into docs/created_updated_at_cols YuriiMotov Aug 25, 2025 https://github.com/fastapi/sqlmodel/pull/372/commits/06e04711d9eb412929523a6cc91007195f446401
bf882be Update formatting of code include block and warning block YuriiMotov Aug 25, 2025 https://github.com/fastapi/sqlmodel/pull/372/commits/bf882bedb4f0110faa6ae54f33377055f1f2b9b0
Clear filters https://github.com/fastapi/sqlmodel/pull/372/files
Please reload this pagehttps://github.com/fastapi/sqlmodel/pull/372/files
Please reload this pagehttps://github.com/fastapi/sqlmodel/pull/372/files
sa-column.md https://github.com/fastapi/sqlmodel/pull/372/files#diff-5bf8daf38a7fdd4648dbf8e6bdc5d00e6872217b7fc486651d348560d607d48a
__init__.py https://github.com/fastapi/sqlmodel/pull/372/files#diff-e73e38dfc185bd110e33eee1529a4bc2309b634a884b27ce073383fce3fe2330
tutorial001.py https://github.com/fastapi/sqlmodel/pull/372/files#diff-3b53000f1050f80bb28060f2d85b9514fb677a96e6b66598b8e83fa588d82204
mkdocs.yml https://github.com/fastapi/sqlmodel/pull/372/files#diff-98d0f806abc9af24e6a7c545d3d77e8f9ad57643e27211d7a7b896113e420ed2
docs/advanced/sa-column.mdhttps://github.com/fastapi/sqlmodel/pull/372/files#diff-5bf8daf38a7fdd4648dbf8e6bdc5d00e6872217b7fc486651d348560d607d48a
View file https://github.com/RobertRosca/sqlmodel/blob/bf882bedb4f0110faa6ae54f33377055f1f2b9b0/docs/advanced/sa-column.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/fastapi/sqlmodel/pull/372/{{ revealButtonHref }}
Please reload this pagehttps://github.com/fastapi/sqlmodel/pull/372/files
YuriiMotovhttps://github.com/YuriiMotov
Aug 25, 2025https://github.com/fastapi/sqlmodel/pull/372/files#r2297682440
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/fastapi/sqlmodel/pull/372/files
docs_src/advanced/sa_column/__init__.pyhttps://github.com/fastapi/sqlmodel/pull/372/files#diff-e73e38dfc185bd110e33eee1529a4bc2309b634a884b27ce073383fce3fe2330
View file https://github.com/RobertRosca/sqlmodel/blob/bf882bedb4f0110faa6ae54f33377055f1f2b9b0/docs_src/advanced/sa_column/__init__.py
Open in desktop https://desktop.github.com
docs_src/advanced/sa_column/tutorial001.pyhttps://github.com/fastapi/sqlmodel/pull/372/files#diff-3b53000f1050f80bb28060f2d85b9514fb677a96e6b66598b8e83fa588d82204
View file https://github.com/RobertRosca/sqlmodel/blob/bf882bedb4f0110faa6ae54f33377055f1f2b9b0/docs_src/advanced/sa_column/tutorial001.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/fastapi/sqlmodel/pull/372/{{ revealButtonHref }}
YuriiMotovhttps://github.com/YuriiMotov
Aug 25, 2025https://github.com/fastapi/sqlmodel/pull/372/files#r2297688579
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/fastapi/sqlmodel/pull/372/files
YuriiMotovhttps://github.com/YuriiMotov
Aug 25, 2025https://github.com/fastapi/sqlmodel/pull/372/files#r2297690153
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/fastapi/sqlmodel/pull/372/files
YuriiMotovhttps://github.com/YuriiMotov
Aug 25, 2025https://github.com/fastapi/sqlmodel/pull/372/files#r2297692862
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/fastapi/sqlmodel/pull/372/files
YuriiMotovhttps://github.com/YuriiMotov
Aug 25, 2025https://github.com/fastapi/sqlmodel/pull/372/files#r2297693795
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/fastapi/sqlmodel/pull/372/files
YuriiMotovhttps://github.com/YuriiMotov
Aug 25, 2025https://github.com/fastapi/sqlmodel/pull/372/files#r2297696848
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/fastapi/sqlmodel/pull/372/files
mkdocs.ymlhttps://github.com/fastapi/sqlmodel/pull/372/files#diff-98d0f806abc9af24e6a7c545d3d77e8f9ad57643e27211d7a7b896113e420ed2
View file https://github.com/RobertRosca/sqlmodel/blob/bf882bedb4f0110faa6ae54f33377055f1f2b9b0/mkdocs.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/fastapi/sqlmodel/pull/372/{{ revealButtonHref }}
https://github.com/fastapi/sqlmodel/pull/372/files#diff-98d0f806abc9af24e6a7c545d3d77e8f9ad57643e27211d7a7b896113e420ed2
https://github.com/fastapi/sqlmodel/pull/372/files#diff-98d0f806abc9af24e6a7c545d3d77e8f9ad57643e27211d7a7b896113e420ed2
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.