René's URL Explorer Experiment


Title: Redesign the row methods of the DB wrapper · Issue #126 · PyGreSQL/PyGreSQL · GitHub

Open Graph Title: Redesign the row methods of the DB wrapper · Issue #126 · PyGreSQL/PyGreSQL

X Title: Redesign the row methods of the DB wrapper · Issue #126 · PyGreSQL/PyGreSQL

Description: The row methods of the DB wrapper (get(), insert(), update(), upsert(), delete()) have grown over time. Their API was designed around tables with OIDs, which no longer exist since PostgreSQL 12, and it has several inconsistencies that ca...

Open Graph Description: The row methods of the DB wrapper (get(), insert(), update(), upsert(), delete()) have grown over time. Their API was designed around tables with OIDs, which no longer exist since PostgreSQL 12, an...

X Description: The row methods of the DB wrapper (get(), insert(), update(), upsert(), delete()) have grown over time. Their API was designed around tables with OIDs, which no longer exist since PostgreSQL 12, an...

Opengraph URL: https://github.com/PyGreSQL/PyGreSQL/issues/126

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Redesign the row methods of the DB wrapper","articleBody":"The row methods of the `DB` wrapper (`get()`, `insert()`, `update()`, `upsert()`, `delete()`) have grown over time. Their API was designed around tables with OIDs, which no longer exist since PostgreSQL 12, and it has several inconsistencies that cannot be fixed without breaking changes. I'd like to redesign them in 7.0. This issue describes the problems and collects suggestions. It does not decide on the new API yet.\n\nFor 6.3, I'm adding a `keyname` parameter to `update()`, `delete()` and `upsert()` like the one in `get()`, so tables without a primary key can be used (#56), and removing the remaining OID support. These changes are backward compatible, but the problems below remain.\n\n## Problems\n\n- **Keyword arguments mean different things.** In `insert()`, `update()` and `delete()`, keyword arguments are column values that are merged into the row dict. In `upsert()`, they are rules for updating columns on conflict (`True`, `False`/`None` or an SQL expression).\n- **Parameter names collide with column names.** Since columns are passed as keyword arguments, columns named `table`, `row` or `keyname` cannot be passed that way. For `upsert()`, no update rule can be given for such a column at all.\n- **Awkward \"do nothing\".** To leave an existing row unchanged, you have to call `upsert(table, row, **dict.fromkeys(row))`. `ON CONFLICT DO NOTHING` without a conflict target, conflicts on a constraint name (needed for exclusion constraints), and `WHERE` clauses cannot be expressed.\n- **The passed dict is modified in place** and also returned. This side effect is surprising, and in `upsert()` it is the only way to get the result.\n- **Errors pass silently.** `update()` returns the row unchanged if no row matches the key, so the caller cannot tell whether anything was updated. `get()` raises a `DatabaseError` in this case, and `delete()` returns the number of deleted rows.\n- **Leftovers of the OID design.** The `oid(table)` keys, the `oid` keyword for identifying rows, and the `with_oid` parameter of `get_attnames()`.\n- **Table names** are handled inconsistently, see #67 (schema-qualified names, the `*` suffix for descendant tables).\n\n## Suggestions (to be discussed)\n\n- Pass column values only in the row (a dict or keyword arguments, but not both), and make all options keyword-only with names that are clearly not column names. Or the opposite: keep `**kw` for column values only, and move the update rules of `upsert()` to a parameter, e.g. `upsert(table, row, keyname=None, update=None)` where `update` is a list of columns or a dict of columns to `True`/`False`/SQL expressions, and an empty list means `DO NOTHING`.\n- Return a new dict instead of modifying the passed one, or make this an option.\n- Let `update()` signal a missing row like `get()` (raise an exception), or return `None`.\n- Support conflict targets given as columns or as a constraint name, and optionally `DO NOTHING` without a target.\n- Look at how others do it: psycopg 3 has no such helpers. SQLAlchemy has `insert().on_conflict_do_update(index_elements=..., constraint=..., set_=..., where=...)` and `on_conflict_do_nothing()`. Django has `bulk_create(update_conflicts=True, unique_fields=..., update_fields=...)`.\n- Transition: new method names, or deprecation warnings in a 6.x release before changing the existing methods.\n","author":{"url":"https://github.com/Cito","@type":"Person","name":"Cito"},"datePublished":"2026-11-22T18:41:12Z","url":"https://github.com/PyGreSQL/PyGreSQL/issues/126"}

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:5d5fbfa1-d404-a9f0-fc99-84b224ada586
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id856C:154661:35B58:4BA00:6B046167
html-safe-noncedcafd50cc08070520563378aab7d74f3c202a54bd85d985d27b4212a2e117e79
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTZDOjE1NDY2MTozNUI1ODo0QkEwMDo2QjA0NjE2NyIsInZpc2l0b3JfaWQiOiI4MTExNTUwMzY0NTg4OTkwODIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac0e7b873ec847126aa0ff7e8d2f823e797943ac4cfaf608325373e8b6216e3ed6
hovercard-subject-tagissue:6546209826
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/PyGreSQL/PyGreSQL/126/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a43e457f220809f079b7f04fb86d4559b07ae3dbbc51c40c42ec39fcefad8510/PyGreSQL/PyGreSQL/issues/126
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a43e457f220809f079b7f04fb86d4559b07ae3dbbc51c40c42ec39fcefad8510/PyGreSQL/PyGreSQL/issues/126
og:image:altThe row methods of the DB wrapper (get(), insert(), update(), upsert(), delete()) have grown over time. Their API was designed around tables with OIDs, which no longer exist since PostgreSQL 12, an...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameCito
hostnamegithub.com
expected-hostnamegithub.com
None2d58451b4bcb73c33c67bfb6b28fb75fe6d5e279daf9b560fa4fd832f3d8c9a6
turbo-cache-controlno-preview
go-importgithub.com/PyGreSQL/PyGreSQL git https://github.com/PyGreSQL/PyGreSQL.git
octolytics-dimension-user_id60857770
octolytics-dimension-user_loginPyGreSQL
octolytics-dimension-repository_id51212044
octolytics-dimension-repository_nwoPyGreSQL/PyGreSQL
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id51212044
octolytics-dimension-repository_network_root_nwoPyGreSQL/PyGreSQL
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
release03e114520787ad27289207f153520ef97461127c
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PyGreSQL/PyGreSQL/issues/126#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPyGreSQL%2FPyGreSQL%2Fissues%2F126
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%2FPyGreSQL%2FPyGreSQL%2Fissues%2F126
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=PyGreSQL%2FPyGreSQL
Reloadhttps://github.com/PyGreSQL/PyGreSQL/issues/126
Reloadhttps://github.com/PyGreSQL/PyGreSQL/issues/126
Reloadhttps://github.com/PyGreSQL/PyGreSQL/issues/126
PyGreSQLhttps://github.com/PyGreSQL
PyGreSQLhttps://github.com/PyGreSQL/PyGreSQL
Codehttps://github.com/PyGreSQL/PyGreSQL
Issues22 (22)https://github.com/PyGreSQL/PyGreSQL/issues
Pull requests1 (1)https://github.com/PyGreSQL/PyGreSQL/pulls
Actionshttps://github.com/PyGreSQL/PyGreSQL/actions
Projectshttps://github.com/PyGreSQL/PyGreSQL/projects
Security and qualityhttps://github.com/PyGreSQL/PyGreSQL/security
Insightshttps://github.com/PyGreSQL/PyGreSQL/insights
https://github.com/PyGreSQL/PyGreSQL
New issuehttps://github.com/login?return_to=https://github.com/PyGreSQL/PyGreSQL/issues/126
New issuehttps://github.com/login?return_to=https://github.com/PyGreSQL/PyGreSQL/issues/126
Redesign the row methods of the DB wrapperhttps://github.com/PyGreSQL/PyGreSQL/issues/126#top
enhancementhttps://github.com/PyGreSQL/PyGreSQL/issues?q=state%3Aopen%20label%3A%22enhancement%22
7.0https://github.com/PyGreSQL/PyGreSQL/milestone/4
https://github.com/Cito
Citohttps://github.com/Cito
on Nov 22, 2026https://github.com/PyGreSQL/PyGreSQL/issues/126#issue-6546209826
#56https://github.com/PyGreSQL/PyGreSQL/issues/56
Proper way of specifying the schema along with the table #67https://github.com/PyGreSQL/PyGreSQL/issues/67
Citohttps://github.com/Cito
7.0https://github.com/PyGreSQL/PyGreSQL/milestone/4
on Nov 22, 2026https://github.com/PyGreSQL/PyGreSQL/issues/126#event-36940515061
Citohttps://github.com/Cito
enhancementhttps://github.com/PyGreSQL/PyGreSQL/issues?q=state%3Aopen%20label%3A%22enhancement%22
on Nov 22, 2026https://github.com/PyGreSQL/PyGreSQL/issues/126#event-36940516049
Sign up for freehttps://github.com/signup?return_to=https://github.com/PyGreSQL/PyGreSQL/issues/126
Sign in to commenthttps://github.com/login?return_to=https://github.com/PyGreSQL/PyGreSQL/issues/126
enhancementhttps://github.com/PyGreSQL/PyGreSQL/issues?q=state%3Aopen%20label%3A%22enhancement%22
7.0https://github.com/PyGreSQL/PyGreSQL/milestone/4
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.