René's URL Explorer Experiment


Title: sqlite3 docs: explain SELECT-with-literals trick · Issue #96165 · python/cpython · GitHub

Open Graph Title: sqlite3 docs: explain SELECT-with-literals trick · Issue #96165 · python/cpython

X Title: sqlite3 docs: explain SELECT-with-literals trick · Issue #96165 · python/cpython

Description: Some examples use the following SQL trick: # setup code; we only need a "dummy" connection import sqlite3 cx = sqlite3.connect(":memory:") # returns one row with one column: ("a",) row = cx.execute("select 'a' as literal").fetchone() # d...

Open Graph Description: Some examples use the following SQL trick: # setup code; we only need a "dummy" connection import sqlite3 cx = sqlite3.connect(":memory:") # returns one row with one column: ("a",) row = cx.execute...

X Description: Some examples use the following SQL trick: # setup code; we only need a "dummy" connection import sqlite3 cx = sqlite3.connect(":memory:") # returns one row with one column: (&q...

Opengraph URL: https://github.com/python/cpython/issues/96165

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sqlite3 docs: explain SELECT-with-literals trick","articleBody":"Some examples use the following SQL trick:\r\n\r\n```python3\r\n# setup code; we only need a \"dummy\" connection\r\nimport sqlite3\r\ncx = sqlite3.connect(\":memory:\")\r\n\r\n# returns one row with one column: (\"a\",)\r\nrow = cx.execute(\"select 'a' as literal\").fetchone()\r\n\r\n# do stuff with result\r\nprint(row)\r\n```\r\n\r\nSome people may find such examples strange, because:\r\n\r\n- we create a connection to an empty database; it is not immediately obvious why we do this\r\n- it may not be immediatly obvious that you can construct a resulting row by using literals in your query\r\n\r\nWe may consider one or more of the following:\r\n\r\n- Add a _very short_ SQL tutorial\r\n- Add an SQL (and/or) SQLite tips and tricks howto\r\n- Explain how SQL queries work (what is a resulting row , etc.)\r\n\r\n_Originally posted by @erlend-aasland in https://github.com/python/cpython/pull/96122#discussion_r951115951_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-106451\n* gh-106513\n* gh-106645\n* gh-106646\n* gh-106647\n* gh-106648\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/erlend-aasland","@type":"Person","name":"erlend-aasland"},"datePublished":"2022-08-22T08:00:09Z","url":"https://github.com/python/cpython/issues/96165"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:8482c59c-ba63-deca-46d8-bc3223e372a4
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9E64:3B07B3:9B2CB9:C275FA:6B021B32
html-safe-nonce406534d42dcf7792302d21146c181053313188c95dc6ab3fd3a659d80a12dda6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTY0OjNCMDdCMzo5QjJDQjk6QzI3NUZBOjZCMDIxQjMyIiwidmlzaXRvcl9pZCI6IjY1ODY0MDk0OTY0MTM4NzA4OTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac96e43bd88b6b9f603dab7ad79149202811d17f294ad002fb9fa5a4582fb910d7
hovercard-subject-tagissue:1345982684
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/python/cpython/96165/issue_layout
twitter:imagehttps://opengraph.githubassets.com/edbb1664bedd098bcdae4ab4fffb0214faa2e9eefcffa65d57c76b9b07dd65bc/python/cpython/issues/96165
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/edbb1664bedd098bcdae4ab4fffb0214faa2e9eefcffa65d57c76b9b07dd65bc/python/cpython/issues/96165
og:image:altSome examples use the following SQL trick: # setup code; we only need a "dummy" connection import sqlite3 cx = sqlite3.connect(":memory:") # returns one row with one column: ("a",) row = cx.execute...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameerlend-aasland
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/96165#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F96165
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%2Fpython%2Fcpython%2Fissues%2F96165
Sign uphttps://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=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/96165
Reloadhttps://github.com/python/cpython/issues/96165
Reloadhttps://github.com/python/cpython/issues/96165
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/96165
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/96165
sqlite3 docs: explain SELECT-with-literals trickhttps://github.com/python/cpython/issues/96165#top
docsDocumentation in the Doc dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22docs%22
topic-sqlite3https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-sqlite3%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com/erlend-aasland
erlend-aaslandhttps://github.com/erlend-aasland
on Aug 22, 2022https://github.com/python/cpython/issues/96165#issue-1345982684
@erlend-aaslandhttps://github.com/erlend-aasland
#96122 (comment)https://github.com/python/cpython/pull/96122#discussion_r951115951
gh-96165: Clarify passing ":memory:" in sqlite3.connect(). #106451https://github.com/python/cpython/pull/106451
gh-96165: Clarify omitting the FROM clause in SQLite queries. #106513https://github.com/python/cpython/pull/106513
[3.12] gh-96165: Clarify omitting the FROM clause in SQLite queries (GH-106513) #106645https://github.com/python/cpython/pull/106645
[3.11] gh-96165: Clarify omitting the FROM clause in SQLite queries (GH-106513) #106646https://github.com/python/cpython/pull/106646
[3.12] gh-96165: Clarify passing ":memory:" in sqlite3.connect() (GH-106451) #106647https://github.com/python/cpython/pull/106647
[3.11] gh-96165: Clarify passing ":memory:" in sqlite3.connect() (GH-106451) #106648https://github.com/python/cpython/pull/106648
erlend-aaslandhttps://github.com/erlend-aasland
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
docsDocumentation in the Doc dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22docs%22
topic-sqlite3https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-sqlite3%22
on Aug 22, 2022https://github.com/python/cpython/issues/96165#event-7230333677
erlend-aaslandhttps://github.com/erlend-aasland
sqlite3 issueshttps://github.com/orgs/python/projects/23
on Aug 22, 2022https://github.com/python/cpython/issues/96165#event-15231236873
https://github.com/erlend-aasland
erlend-aaslandhttps://github.com/erlend-aasland
on Aug 22, 2022https://github.com/python/cpython/issues/96165#issuecomment-1221992465
@CAM-Gerlachhttps://github.com/CAM-Gerlach
@ezio-melottihttps://github.com/ezio-melotti
https://github.com/ezio-melotti
ezio-melottihttps://github.com/ezio-melotti
on Aug 22, 2022https://github.com/python/cpython/issues/96165#issuecomment-1222030771
https://github.com/CAM-Gerlach
CAM-Gerlachhttps://github.com/CAM-Gerlach
on Aug 23, 2022https://github.com/python/cpython/issues/96165#issuecomment-1223561806
CAM-Gerlachhttps://github.com/CAM-Gerlach
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Aug 23, 2022https://github.com/python/cpython/issues/96165#event-7238506260
CAM-Gerlachhttps://github.com/CAM-Gerlach
sqlite3 issueshttps://github.com/orgs/python/projects/23
on Aug 23, 2022https://github.com/python/cpython/issues/96165
CAM-Gerlachhttps://github.com/CAM-Gerlach
on Aug 23, 2022https://github.com/python/cpython/issues/96165#event-7238507830
https://github.com/CAM-Gerlach
CAM-Gerlachhttps://github.com/CAM-Gerlach
on Aug 23, 2022https://github.com/python/cpython/issues/96165#issuecomment-1223575749
Get the user startedhttps://diataxis.fr/tutorials/#get-the-user-started
unnecessary explainationhttps://diataxis.fr/tutorials/#offer-only-minimum-necessary-explanation
@ezio-melottihttps://github.com/ezio-melotti
@ezio-melottihttps://github.com/ezio-melotti
https://github.com/erlend-aasland
erlend-aaslandhttps://github.com/erlend-aasland
on Aug 23, 2022https://github.com/python/cpython/issues/96165#issuecomment-1223691950
https://github.com/erlend-aasland
erlend-aaslandhttps://github.com/erlend-aasland
on Aug 23, 2022https://github.com/python/cpython/issues/96165#issuecomment-1223694067
erlend-aaslandhttps://github.com/erlend-aasland
sqlite3 issueshttps://github.com/orgs/python/projects/23
on Dec 30, 2022https://github.com/python/cpython/issues/96165
felixxmhttps://github.com/felixxm
on Jul 5, 2023https://github.com/python/cpython/issues/96165#event-9730744288
pythongh-96165: Clarify passing ":memory:" in sqlite3.connect().https://github.com/felixxm/cpython/commit/9dd799081ed809b09907cc5c30d24cadfa0158b0
pythongh-96165https://github.com/python/cpython/issues/96165
9dd7990https://github.com/felixxm/cpython/commit/9dd799081ed809b09907cc5c30d24cadfa0158b0
pythongh-96165: Clarify omitting the FROM clause in SQLite queries.https://github.com/felixxm/cpython/commit/cdc98692c180c6c4d559659fa2895ace05408203
pythongh-96165https://github.com/python/cpython/issues/96165
cdc9869https://github.com/felixxm/cpython/commit/cdc98692c180c6c4d559659fa2895ace05408203
pythongh-96165: Clarify omitting the FROM clause in SQLite queries.https://github.com/felixxm/cpython/commit/182c3a3b45a37cd7d668ca65d884ec1fe28717b2
pythongh-96165https://github.com/python/cpython/issues/96165
182c3a3https://github.com/felixxm/cpython/commit/182c3a3b45a37cd7d668ca65d884ec1fe28717b2
erlend-aaslandhttps://github.com/erlend-aasland
on Jul 11, 2023https://github.com/python/cpython/issues/96165#event-9791831891
gh-96165: Clarify omitting the FROM clause in SQLite queries (#106513)https://github.com/python/cpython/commit/fc7ff1af457e27b7d9752600b3436641be90f598
gh-96165https://github.com/python/cpython/issues/96165
#106513https://github.com/python/cpython/pull/106513
fc7ff1ahttps://github.com/python/cpython/commit/fc7ff1af457e27b7d9752600b3436641be90f598
miss-islingtonhttps://github.com/miss-islington
on Jul 11, 2023https://github.com/python/cpython/issues/96165#event-9791837340
pythongh-96165: Clarify omitting the FROM clause in SQLite queries (p…https://github.com/miss-islington/cpython/commit/8c80fd15409614fee524e43b65a767b6c1f2352e
pythongh-96165https://github.com/python/cpython/issues/96165
p…https://github.com/python/cpython/pull/106513
8c80fd1https://github.com/miss-islington/cpython/commit/8c80fd15409614fee524e43b65a767b6c1f2352e
pythongh-96165: Clarify omitting the FROM clause in SQLite queries (p…https://github.com/miss-islington/cpython/commit/5bcfc155d008f5e235cae3338ec1173e78e6b40c
pythongh-96165https://github.com/python/cpython/issues/96165
p…https://github.com/python/cpython/pull/106513
5bcfc15https://github.com/miss-islington/cpython/commit/5bcfc155d008f5e235cae3338ec1173e78e6b40c
erlend-aaslandhttps://github.com/erlend-aasland
on Jul 11, 2023https://github.com/python/cpython/issues/96165#event-9791906347
gh-96165: Clarify passing ":memory:" in sqlite3.connect() (#106451)https://github.com/python/cpython/commit/f520804b039df0d87fb9df6f1fed2a9bc9df8d61
gh-96165https://github.com/python/cpython/issues/96165
#106451https://github.com/python/cpython/pull/106451
f520804https://github.com/python/cpython/commit/f520804b039df0d87fb9df6f1fed2a9bc9df8d61
miss-islingtonhttps://github.com/miss-islington
on Jul 11, 2023https://github.com/python/cpython/issues/96165#event-9791907223
pythongh-96165: Clarify passing ":memory:" in sqlite3.connect() (pyth…https://github.com/miss-islington/cpython/commit/2205c4b6f78686b79023a9811f904db525b5dd04
pythongh-96165https://github.com/python/cpython/issues/96165
pyth…https://github.com/python/cpython/pull/106451
2205c4bhttps://github.com/miss-islington/cpython/commit/2205c4b6f78686b79023a9811f904db525b5dd04
pythongh-96165: Clarify passing ":memory:" in sqlite3.connect() (pyth…https://github.com/miss-islington/cpython/commit/0d1d572b429ccead4b7263d80c362bc80e7954da
pythongh-96165https://github.com/python/cpython/issues/96165
pyth…https://github.com/python/cpython/pull/106451
0d1d572https://github.com/miss-islington/cpython/commit/0d1d572b429ccead4b7263d80c362bc80e7954da
erlend-aaslandhttps://github.com/erlend-aasland
on Jul 11, 2023https://github.com/python/cpython/issues/96165#event-9792001495
[3.11] gh-96165: Clarify omitting the FROM clause in SQLite queries (G…https://github.com/python/cpython/commit/6d8662381d73982f53d3cc71bf435aa82def8eab
gh-96165https://github.com/python/cpython/issues/96165
G…https://github.com/python/cpython/pull/106513
6d86623https://github.com/python/cpython/commit/6d8662381d73982f53d3cc71bf435aa82def8eab
[3.12] gh-96165: Clarify omitting the FROM clause in SQLite queries (G…https://github.com/python/cpython/commit/bf7e92583dd33aa7e83d5929f2138c5d6957f571
gh-96165https://github.com/python/cpython/issues/96165
G…https://github.com/python/cpython/pull/106513
bf7e925https://github.com/python/cpython/commit/bf7e92583dd33aa7e83d5929f2138c5d6957f571
[3.12] gh-96165: Clarify passing ":memory:" in sqlite3.connect() (GH-…https://github.com/python/cpython/commit/e248ba7b72adad794399d7b55116862fa31471fd
gh-96165https://github.com/python/cpython/issues/96165
GH-…https://github.com/python/cpython/pull/106451
e248ba7https://github.com/python/cpython/commit/e248ba7b72adad794399d7b55116862fa31471fd
[3.11] gh-96165: Clarify passing ":memory:" in sqlite3.connect() (GH-…https://github.com/python/cpython/commit/247f0500b88bb881f563792c7db535e91259b90c
gh-96165https://github.com/python/cpython/issues/96165
GH-…https://github.com/python/cpython/pull/106451
247f050https://github.com/python/cpython/commit/247f0500b88bb881f563792c7db535e91259b90c
https://github.com/erlend-aasland
erlend-aaslandhttps://github.com/erlend-aasland
on Jul 11, 2023https://github.com/python/cpython/issues/96165#issuecomment-1631472641
@felixxmhttps://github.com/felixxm
erlend-aaslandhttps://github.com/erlend-aasland
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 11, 2023https://github.com/python/cpython/issues/96165#event-9792023767
github-project-automationhttps://github.com/apps/github-project-automation
sqlite3 issueshttps://github.com/orgs/python/projects/23
on Jul 11, 2023https://github.com/python/cpython/issues/96165
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/96165
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/96165
docsDocumentation in the Doc dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22docs%22
topic-sqlite3https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-sqlite3%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
sqlite3 issueshttps://github.com/orgs/python/projects/23
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.