René's URL Explorer Experiment


Title: 🐛 Fix setting nullable property of Fields that don't accept `None` by van51 · Pull Request #79 · fastapi/sqlmodel · GitHub

Open Graph Title: 🐛 Fix setting nullable property of Fields that don't accept `None` by van51 · Pull Request #79 · fastapi/sqlmodel

X Title: 🐛 Fix setting nullable property of Fields that don't accept `None` by van51 · Pull Request #79 · fastapi/sqlmodel

Description: Attempt to fix #76 where fields with default values would be considered nullable by sqlmodel, because they would be treated as not_required by Pydantic. Previously The following example code (copy-pasted from the issue) from typing import Optional from sqlmodel import SQLModel, Field, create_engine class Test(SQLModel, table=True): id: Optional[int] = Field(default=None, primary_key=True) a: str b: Optional[str] = None c: str = Field(default="Hey") d: str = "hey" sqlite_url = "" # define a path here engine = create_engine(sqlite_url, echo=True) SQLModel.metadata.create_all(engine) used to produce the following create table SQL command: CREATE TABLE test ( id INTEGER, a VARCHAR NOT NULL, b VARCHAR, c VARCHAR, d VARCHAR, PRIMARY KEY (id) ) Now This PR produces: CREATE TABLE test ( id INTEGER NOT NULL, a VARCHAR NOT NULL, b VARCHAR, c VARCHAR NOT NULL, d VARCHAR NOT NULL, PRIMARY KEY (id) ) Please let me know what you think.

Open Graph Description: Attempt to fix #76 where fields with default values would be considered nullable by sqlmodel, because they would be treated as not_required by Pydantic. Previously The following example code (copy-...

X Description: Attempt to fix #76 where fields with default values would be considered nullable by sqlmodel, because they would be treated as not_required by Pydantic. Previously The following example code (copy-...

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

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:61e68bc4-6155-c84d-3995-ca82cf7ceb02
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA958:10C066:37ECAC:4BCB2E:6AFE1E54
html-safe-noncee785725aa61df6c69610c5b234570db8941f00c78e6fe096d1a6bca5171013e2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTU4OjEwQzA2NjozN0VDQUM6NEJDQjJFOjZBRkUxRTU0IiwidmlzaXRvcl9pZCI6IjEwNzg4NDU5MTMzODk5OTc2NTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace4a27d99180d4f1ea1d9762a807ccaeef54b5189934239262b6b6fd24a2b2645
hovercard-subject-tagpull_request:727751133
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/79/files
twitter:imagehttps://avatars.githubusercontent.com/u/1083772?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1083772?s=400&v=4
og:image:altAttempt to fix #76 where fields with default values would be considered nullable by sqlmodel, because they would be treated as not_required by Pydantic. Previously The following example code (copy-...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned0525ab1464526bf4532a5551aa348cf100dff75ef808a96fc67a08b1d946aa9
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
releasefef3993a71fa20f7be8e167132fbf9619bc66e12
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/fastapi/sqlmodel/pull/79/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffastapi%2Fsqlmodel%2Fpull%2F79%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%2F79%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/79/files
Reloadhttps://github.com/fastapi/sqlmodel/pull/79/files
Reloadhttps://github.com/fastapi/sqlmodel/pull/79/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
tiangolohttps://github.com/tiangolo
fastapi:mainhttps://github.com/fastapi/sqlmodel/tree/main
van51:bugfix/nullable_fieldhttps://github.com/van51/sqlmodel/tree/bugfix/nullable_field
Conversation 10 https://github.com/fastapi/sqlmodel/pull/79
Commits 3 https://github.com/fastapi/sqlmodel/pull/79/commits
Checks 0 https://github.com/fastapi/sqlmodel/pull/79/checks
Files changed https://github.com/fastapi/sqlmodel/pull/79/files
Please reload this pagehttps://github.com/fastapi/sqlmodel/pull/79/files
🐛 Fix setting nullable property of Fields that don't accept None https://github.com/fastapi/sqlmodel/pull/79/files#top
Show all changes 3 commits https://github.com/fastapi/sqlmodel/pull/79/files
83870d1 🎨 Fix nullable property of Fields van51 Sep 3, 2021 https://github.com/fastapi/sqlmodel/pull/79/commits/83870d19d6aa6b9b7cd93183d9729b023c8208b2
2877c12 Merge branch 'main' into bugfix/nullable_field tiangolo Aug 27, 2022 https://github.com/fastapi/sqlmodel/pull/79/commits/2877c12f33a4bed96814b2fa1a8534756dc1da89
33daef3 ♻️ Move isnullable check after attribute to reset if it's a primary key tiangolo Aug 27, 2022 https://github.com/fastapi/sqlmodel/pull/79/commits/33daef3033d92e790b1c54b6ae4ebbf60a735813
Clear filters https://github.com/fastapi/sqlmodel/pull/79/files
Please reload this pagehttps://github.com/fastapi/sqlmodel/pull/79/files
Please reload this pagehttps://github.com/fastapi/sqlmodel/pull/79/files
main.py https://github.com/fastapi/sqlmodel/pull/79/files#diff-d47aa94b4399636b3bf61c282806410ca16c47e6edb13a2d3ba675f9460e7389
test_tutorial001.py https://github.com/fastapi/sqlmodel/pull/79/files#diff-30a046cea2f549df11e5e43ca192660bbb142a9fb855afe518759df953a775d2
sqlmodel/main.pyhttps://github.com/fastapi/sqlmodel/pull/79/files#diff-d47aa94b4399636b3bf61c282806410ca16c47e6edb13a2d3ba675f9460e7389
View file https://github.com/van51/sqlmodel/blob/33daef3033d92e790b1c54b6ae4ebbf60a735813/sqlmodel/main.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/fastapi/sqlmodel/pull/79/{{ revealButtonHref }}
https://github.com/fastapi/sqlmodel/pull/79/files#diff-d47aa94b4399636b3bf61c282806410ca16c47e6edb13a2d3ba675f9460e7389
https://github.com/fastapi/sqlmodel/pull/79/files#diff-d47aa94b4399636b3bf61c282806410ca16c47e6edb13a2d3ba675f9460e7389
https://github.com/fastapi/sqlmodel/pull/79/files#diff-d47aa94b4399636b3bf61c282806410ca16c47e6edb13a2d3ba675f9460e7389
https://github.com/fastapi/sqlmodel/pull/79/files#diff-d47aa94b4399636b3bf61c282806410ca16c47e6edb13a2d3ba675f9460e7389
https://github.com/fastapi/sqlmodel/pull/79/files#diff-d47aa94b4399636b3bf61c282806410ca16c47e6edb13a2d3ba675f9460e7389
tests/test_tutorial/test_create_db_and_table/test_tutorial001.pyhttps://github.com/fastapi/sqlmodel/pull/79/files#diff-30a046cea2f549df11e5e43ca192660bbb142a9fb855afe518759df953a775d2
View file https://github.com/van51/sqlmodel/blob/33daef3033d92e790b1c54b6ae4ebbf60a735813/tests/test_tutorial/test_create_db_and_table/test_tutorial001.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/fastapi/sqlmodel/pull/79/{{ revealButtonHref }}
https://github.com/fastapi/sqlmodel/pull/79/files#diff-30a046cea2f549df11e5e43ca192660bbb142a9fb855afe518759df953a775d2
https://github.com/fastapi/sqlmodel/pull/79/files#diff-30a046cea2f549df11e5e43ca192660bbb142a9fb855afe518759df953a775d2
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.