Title: Wrong type when using sum function · Issue #85 · sqlc-dev/sqlc-gen-python · GitHub
Open Graph Title: Wrong type when using sum function · Issue #85 · sqlc-dev/sqlc-gen-python
X Title: Wrong type when using sum function · Issue #85 · sqlc-dev/sqlc-gen-python
Description: Let's say we have my_table.my_numeric being of numeric type. From this query SELECT my_numeric FROM my_table WHERE key = @key; We have this function generated def tmp(self, *, key: uuid.UUID) -> Optional[decimal.Decimal]: But when a func...
Open Graph Description: Let's say we have my_table.my_numeric being of numeric type. From this query SELECT my_numeric FROM my_table WHERE key = @key; We have this function generated def tmp(self, *, key: uuid.UUID) -> Op...
X Description: Let's say we have my_table.my_numeric being of numeric type. From this query SELECT my_numeric FROM my_table WHERE key = @key; We have this function generated def tmp(self, *, key: uuid.UUID) -...
Opengraph URL: https://github.com/sqlc-dev/sqlc-gen-python/issues/85
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Wrong type when using sum function","articleBody":"Let's say we have `my_table.my_numeric` being of numeric type.\n\nFrom this query\n```\nSELECT my_numeric FROM my_table WHERE key = @key;\n```\n\nWe have this function generated\n```\ndef tmp(self, *, key: uuid.UUID) -\u003e Optional[decimal.Decimal]:\n```\n\nBut when a function like a sum is used\n```\nSELECT SUM(my_numeric) FROM my_table;\n```\n\nIt's typed with an int\n```\ndef tmp(self) -\u003e Optional[int]:\n```\nEven though it actually returns a Decimal\n\nOf course, explicit typing properly works\n```\nSELECT SUM(my_numeric)::numeric FROM my_table;\n```\n```\ndef tmp(self) -\u003e Optional[decimal.Decimal]:\n```\n\n","author":{"url":"https://github.com/Maveldu","@type":"Person","name":"Maveldu"},"datePublished":"2025-05-16T08:12:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/85/sqlc-gen-python/issues/85"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9ae35d6a-c2df-d3b2-bf04-80cd8624e34f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B8E8:3695F9:21ACD9:2D591A:696E6E95 |
| html-safe-nonce | bd51cc12ec892eb4d7273c773b1dc78e6bb343e2fe1da4c9d833a37f173d87c9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOEU4OjM2OTVGOToyMUFDRDk6MkQ1OTFBOjY5NkU2RTk1IiwidmlzaXRvcl9pZCI6IjczMjY4MjQyODQ1ODM2NDU2NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8523e13541d7fa38a93e44f006bbf6c3cec75352da3305cfe8130fcf7aba46c8 |
| hovercard-subject-tag | issue:3068285229 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/sqlc-dev/sqlc-gen-python/85/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dab5d5dda27db6508ba5c00e4fe199ec3531a18f6fe35b04e57767946260d5ad/sqlc-dev/sqlc-gen-python/issues/85 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dab5d5dda27db6508ba5c00e4fe199ec3531a18f6fe35b04e57767946260d5ad/sqlc-dev/sqlc-gen-python/issues/85 |
| og:image:alt | Let's say we have my_table.my_numeric being of numeric type. From this query SELECT my_numeric FROM my_table WHERE key = @key; We have this function generated def tmp(self, *, key: uuid.UUID) -> Op... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Maveldu |
| hostname | github.com |
| expected-hostname | github.com |
| None | 01185010a96388a2a8cd8bd7f5824fdf090522b219f9aecf8c7ff1857aeb489b |
| turbo-cache-control | no-preview |
| go-import | github.com/sqlc-dev/sqlc-gen-python git https://github.com/sqlc-dev/sqlc-gen-python.git |
| octolytics-dimension-user_id | 136738596 |
| octolytics-dimension-user_login | sqlc-dev |
| octolytics-dimension-repository_id | 548530161 |
| octolytics-dimension-repository_nwo | sqlc-dev/sqlc-gen-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 548530161 |
| octolytics-dimension-repository_network_root_nwo | sqlc-dev/sqlc-gen-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 673a80c1bce2a1e6a48b530ce2b72bf8fd253386 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width