René's URL Explorer Experiment


Title: Python: Eliminate runtime package and use sqlalchemy by robholt · Pull Request #939 · sqlc-dev/sqlc · GitHub

Open Graph Title: Python: Eliminate runtime package and use sqlalchemy by robholt · Pull Request #939 · sqlc-dev/sqlc

X Title: Python: Eliminate runtime package and use sqlalchemy by robholt · Pull Request #939 · sqlc-dev/sqlc

Description: Based on comments on my initial python codegen PR I've put together some potential changes to the generated python code. I've marked this as a draft PR because I've only made manual edits to the authors example. Once we have a more solid idea of what the generated python code should look like I'll make the changes to the actual codegen code. A quick overview of the changes: Use stdlib dataclasses instead of pydantic Use sqlalchemy as the execution engine Query functions are now inside of classes Eliminated the positional param issue, now $1 is replaced with :p1 instead of just %s. Notes: Asyncio support in sqlalchemy requires the 1.4 release, which is currently in beta. Not really a long-term issue though, as it will eventually be out of beta. I've also confirmed the non-async code works fine with the latest stable 1.3.x release. The : character is special to sqlalchemy. The codegen will need to replace : with \\: in queries. I don't think this will cause issues, but there's always the potential for edge-case issues with regex replaces on the queries.

Open Graph Description: Based on comments on my initial python codegen PR I've put together some potential changes to the generated python code. I've marked this as a draft PR because I've only made manual edi...

X Description: Based on comments on my initial python codegen PR I've put together some potential changes to the generated python code. I've marked this as a draft PR because I've only mad...

Opengraph URL: https://github.com/sqlc-dev/sqlc/pull/939

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:ba77a81e-5cd1-574c-b66b-e25562a3b841
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id86F6:1087D4:27FF8A4:35793BB:6B01B867
html-safe-nonce1cdc5426f267305475743ca0245e7d8e292f1e0e33ad27e8e1ea210fc1f619f9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NkY2OjEwODdENDoyN0ZGOEE0OjM1NzkzQkI6NkIwMUI4NjciLCJ2aXNpdG9yX2lkIjoiMzQwMDY5MDcxNjYxODM3MzIyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac9f72bcc73d85b6ba1131dc8f32e26a93d097e00701ed0679789e90aaced356ed
hovercard-subject-tagpull_request:590926710
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/sqlc-dev/sqlc/pull/939/files
twitter:imagehttps://avatars.githubusercontent.com/u/794548?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/794548?s=400&v=4
og:image:altBased on comments on my initial python codegen PR I've put together some potential changes to the generated python code. I've marked this as a draft PR because I've only made manual edi...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/sqlc-dev/sqlc git https://github.com/sqlc-dev/sqlc.git
octolytics-dimension-user_id136738596
octolytics-dimension-user_loginsqlc-dev
octolytics-dimension-repository_id193160679
octolytics-dimension-repository_nwosqlc-dev/sqlc
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id193160679
octolytics-dimension-repository_network_root_nwosqlc-dev/sqlc
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/sqlc-dev/sqlc/pull/939/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsqlc-dev%2Fsqlc%2Fpull%2F939%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%2Fsqlc-dev%2Fsqlc%2Fpull%2F939%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=sqlc-dev%2Fsqlc
Reloadhttps://github.com/sqlc-dev/sqlc/pull/939/files
Reloadhttps://github.com/sqlc-dev/sqlc/pull/939/files
Reloadhttps://github.com/sqlc-dev/sqlc/pull/939/files
sqlc-devhttps://github.com/sqlc-dev
sqlchttps://github.com/sqlc-dev/sqlc
Codehttps://github.com/sqlc-dev/sqlc
Issues600 (600)https://github.com/sqlc-dev/sqlc/issues
Pull requests132 (132)https://github.com/sqlc-dev/sqlc/pulls
Discussionshttps://github.com/sqlc-dev/sqlc/discussions
Actionshttps://github.com/sqlc-dev/sqlc/actions
Projectshttps://github.com/sqlc-dev/sqlc/projects
Security and qualityhttps://github.com/sqlc-dev/sqlc/security
Insightshttps://github.com/sqlc-dev/sqlc/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fsqlc-dev%2Fsqlc%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsqlc-dev%2Fsqlc%2Fissues%2Fnew%2Fchoose
kyleconroyhttps://github.com/kyleconroy
sqlc-dev:masterhttps://github.com/sqlc-dev/sqlc/tree/master
robholt:python-improvementshttps://github.com/robholt/sqlc/tree/python-improvements
Conversation 17 https://github.com/sqlc-dev/sqlc/pull/939
Commits 3 https://github.com/sqlc-dev/sqlc/pull/939/commits
Checks 0 https://github.com/sqlc-dev/sqlc/pull/939/checks
Files changed https://github.com/sqlc-dev/sqlc/pull/939/files
Please reload this pagehttps://github.com/sqlc-dev/sqlc/pull/939/files
Python: Eliminate runtime package and use sqlalchemy https://github.com/sqlc-dev/sqlc/pull/939/files#top
Show all changes 3 commits https://github.com/sqlc-dev/sqlc/pull/939/files
c95b5ef Manually edit python example code Mar 11, 2021 https://github.com/sqlc-dev/sqlc/pull/939/commits/c95b5efcac419c89c7cfd55a935dfffd918e671c
d9c77db Remove leftover debug code in python tests Mar 11, 2021 https://github.com/sqlc-dev/sqlc/pull/939/commits/d9c77db3e1e3cf6c3478ab8be833f156be76eda2
5f73dbd Python: implement new codegen Mar 15, 2021 https://github.com/sqlc-dev/sqlc/pull/939/commits/5f73dbdaca13f5e5484d60d035e5ab00df741e21
Clear filters https://github.com/sqlc-dev/sqlc/pull/939/files
Please reload this pagehttps://github.com/sqlc-dev/sqlc/pull/939/files
Please reload this pagehttps://github.com/sqlc-dev/sqlc/pull/939/files
requirements.txt https://github.com/sqlc-dev/sqlc/pull/939/files#diff-c233c301c314607d2dfcee9a9ec0d5a7b78a67d2c8927808fd4c9d382bbb4a8e
sqlc.json https://github.com/sqlc-dev/sqlc/pull/939/files#diff-51ce5461fb9e627abb72ef91a05f41da8a7272d3d6d9101fe941b3b5ed7d99d9
models.py https://github.com/sqlc-dev/sqlc/pull/939/files#diff-ee5ac580ad63bf714e44b9be5731416a492cf541f81038ad93aa944ad974a4c4
query.py https://github.com/sqlc-dev/sqlc/pull/939/files#diff-c89f8979af02e775ccddfaba91d614eddb3bab71498afba34cc43d6464cffad9
models.py https://github.com/sqlc-dev/sqlc/pull/939/files#diff-96909b321988c2a971e29eaa178d76f6c13550c628fc9238525934947d95c7bf
query.py https://github.com/sqlc-dev/sqlc/pull/939/files#diff-ecc31cbe8cf7dd3168f2145777c647e51a41fed5f009a2ca5531136b75d3513c
migrations.py https://github.com/sqlc-dev/sqlc/pull/939/files#diff-085a2592d365b45529f54567683e6f86bcfcaacf6861c444c1f1587f6198e803
models.py https://github.com/sqlc-dev/sqlc/pull/939/files#diff-bb527e6d8bb3ab4658d672ea3f63e9c5c583c927cc70cab2ec1066d5c2364e4a
query-building.py https://github.com/sqlc-dev/sqlc/pull/939/files#diff-509b3335e4fbca4d213186c60be3d59e4f1d53846d86dd576357315b09e8ce08
city.py https://github.com/sqlc-dev/sqlc/pull/939/files#diff-bdad798e6b8e85201714a8192ac42845523dbbb5a5a017d6b739ef66e5839fc1
models.py https://github.com/sqlc-dev/sqlc/pull/939/files#diff-4fe6296bd7df312e72842738a7944d256832948fbb1df1adeaab3a9391fc3eee
venue.py https://github.com/sqlc-dev/sqlc/pull/939/files#diff-40122bbc61cbbfbffce8e3eb9733a7701e4c3cb675a4190f93b76172ee6dc03c
conftest.py https://github.com/sqlc-dev/sqlc/pull/939/files#diff-6fb414c226d7f3b94d6748e88dbd6f5839d7843cd1b7c6e75ced2f014bc22b89
test_authors.py https://github.com/sqlc-dev/sqlc/pull/939/files#diff-25cbb374c04950655a28cbc365e7abb6c80108da5c564057c41f8bad903a84c3
test_booktest.py https://github.com/sqlc-dev/sqlc/pull/939/files#diff-2f6d7f5b3991bc5a950ba891a64ef574e2be28ff5506b892fc3a36bc355e0f89
test_ondeck.py https://github.com/sqlc-dev/sqlc/pull/939/files#diff-9472850ce0e42b3e9a2c736765bc700caeff7cae221c83866f7337d41d743e86
gen.go https://github.com/sqlc-dev/sqlc/pull/939/files#diff-4a1cf90ba2481aa2ceb7d4fa05de163b7af23afe883d14d85dac6f7bd031fe67
imports.go https://github.com/sqlc-dev/sqlc/pull/939/files#diff-ec691f29985038d8622fe3e038f5ef9ea3dab8bde745df1a7a201d1e5a35b3e5
config.go https://github.com/sqlc-dev/sqlc/pull/939/files#diff-54c7c1af5fa8d5db4dc49f0e8e80e93ba2b1183ba4d5c9e2e5729e6deae6a3cd
v_two.go https://github.com/sqlc-dev/sqlc/pull/939/files#diff-5cbb844a4791fafa0b189ed613ce169fd9157f636b7767f35555c62d91206bd4
examples/python/requirements.txthttps://github.com/sqlc-dev/sqlc/pull/939/files#diff-c233c301c314607d2dfcee9a9ec0d5a7b78a67d2c8927808fd4c9d382bbb4a8e
View file https://github.com/robholt/sqlc/blob/5f73dbdaca13f5e5484d60d035e5ab00df741e21/examples/python/requirements.txt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/sqlc-dev/sqlc/pull/939/{{ revealButtonHref }}
https://github.com/sqlc-dev/sqlc/pull/939/files#diff-c233c301c314607d2dfcee9a9ec0d5a7b78a67d2c8927808fd4c9d382bbb4a8e
examples/python/sqlc.jsonhttps://github.com/sqlc-dev/sqlc/pull/939/files#diff-51ce5461fb9e627abb72ef91a05f41da8a7272d3d6d9101fe941b3b5ed7d99d9
View file https://github.com/robholt/sqlc/blob/5f73dbdaca13f5e5484d60d035e5ab00df741e21/examples/python/sqlc.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/sqlc-dev/sqlc/pull/939/{{ revealButtonHref }}
https://github.com/sqlc-dev/sqlc/pull/939/files#diff-51ce5461fb9e627abb72ef91a05f41da8a7272d3d6d9101fe941b3b5ed7d99d9
Please reload this pagehttps://github.com/sqlc-dev/sqlc/pull/939/files
https://github.com/sqlc-dev/sqlc/pull/939/files#diff-51ce5461fb9e627abb72ef91a05f41da8a7272d3d6d9101fe941b3b5ed7d99d9
https://github.com/sqlc-dev/sqlc/pull/939/files#diff-51ce5461fb9e627abb72ef91a05f41da8a7272d3d6d9101fe941b3b5ed7d99d9
https://github.com/sqlc-dev/sqlc/pull/939/files#diff-51ce5461fb9e627abb72ef91a05f41da8a7272d3d6d9101fe941b3b5ed7d99d9
https://github.com/sqlc-dev/sqlc/pull/939/files#diff-51ce5461fb9e627abb72ef91a05f41da8a7272d3d6d9101fe941b3b5ed7d99d9
examples/python/src/authors/models.pyhttps://github.com/sqlc-dev/sqlc/pull/939/files#diff-ee5ac580ad63bf714e44b9be5731416a492cf541f81038ad93aa944ad974a4c4
View file https://github.com/robholt/sqlc/blob/5f73dbdaca13f5e5484d60d035e5ab00df741e21/examples/python/src/authors/models.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/sqlc-dev/sqlc/pull/939/{{ revealButtonHref }}
Please reload this pagehttps://github.com/sqlc-dev/sqlc/pull/939/files
https://github.com/sqlc-dev/sqlc/pull/939/files#diff-ee5ac580ad63bf714e44b9be5731416a492cf541f81038ad93aa944ad974a4c4
examples/python/src/authors/query.pyhttps://github.com/sqlc-dev/sqlc/pull/939/files#diff-c89f8979af02e775ccddfaba91d614eddb3bab71498afba34cc43d6464cffad9
View file https://github.com/robholt/sqlc/blob/5f73dbdaca13f5e5484d60d035e5ab00df741e21/examples/python/src/authors/query.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/sqlc-dev/sqlc/pull/939/{{ revealButtonHref }}
examples/python/src/booktest/models.pyhttps://github.com/sqlc-dev/sqlc/pull/939/files#diff-96909b321988c2a971e29eaa178d76f6c13550c628fc9238525934947d95c7bf
View file https://github.com/robholt/sqlc/blob/5f73dbdaca13f5e5484d60d035e5ab00df741e21/examples/python/src/booktest/models.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/sqlc-dev/sqlc/pull/939/{{ revealButtonHref }}
https://github.com/sqlc-dev/sqlc/pull/939/files#diff-96909b321988c2a971e29eaa178d76f6c13550c628fc9238525934947d95c7bf
https://github.com/sqlc-dev/sqlc/pull/939/files#diff-96909b321988c2a971e29eaa178d76f6c13550c628fc9238525934947d95c7bf
Please reload this pagehttps://github.com/sqlc-dev/sqlc/pull/939/files
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.