Title: Support generating pointers for nullable enum types (emit_pointers_for_null_types for enums) · Issue #3276 · sqlc-dev/sqlc · GitHub
Open Graph Title: Support generating pointers for nullable enum types (emit_pointers_for_null_types for enums) · Issue #3276 · sqlc-dev/sqlc
X Title: Support generating pointers for nullable enum types (emit_pointers_for_null_types for enums) · Issue #3276 · sqlc-dev/sqlc
Description: What do you want to change? Currently, when a field is nullable and an enum, sqlc always generates a new type with a prefix Null. This Null___ type is a struct that wraps the enum's string alias type and adds a Valid boolean property to ...
Open Graph Description: What do you want to change? Currently, when a field is nullable and an enum, sqlc always generates a new type with a prefix Null. This Null___ type is a struct that wraps the enum's string alias ty...
X Description: What do you want to change? Currently, when a field is nullable and an enum, sqlc always generates a new type with a prefix Null. This Null___ type is a struct that wraps the enum's string alia...
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/3276
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support generating pointers for nullable enum types (emit_pointers_for_null_types for enums)","articleBody":"### What do you want to change?\r\n\r\nCurrently, when a field is nullable and an enum, sqlc always generates a new type with a prefix `Null`. This `Null___` type is a struct that wraps the enum's string alias type and adds a `Valid` boolean property to represent the `NULL` state.\r\n\r\nsqlc has a setting called `emit_pointers_for_null_types` which replaces similar nullable wrapper types with pointers instead (`NullString` -\u003e `*string`)\r\n\r\nThis feature request seeks to bring similar functionality to nullable enum fields. Instead of generating a `Null___` type for a nullable enum field, it should be a represented by a pointer (`NullFooEnum` -\u003e `*FooEnum`)\r\n\r\n### Questions\r\n\r\n- If this feature were to be implemented, should it be enabled by the existing `emit_pointers_for_null_types` config setting? Or should it be a separate setting?\r\n\r\n### Other notes\r\n\r\nI couldn't find an existing issue for this, but there is an open PR #3093 which seemed to be working towards the same goal.\r\n\r\n### What database engines need to be changed?\r\n\r\n_No response_\r\n\r\n### What programming language backends need to be changed?\r\n\r\n_No response_","author":{"url":"https://github.com/nderscore","@type":"Person","name":"nderscore"},"datePublished":"2024-03-15T18:10:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/3276/sqlc/issues/3276"}
| 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:a7ef21bc-4446-8946-5c92-0d0ce353b012 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E82A:139708:42FF7F8:5DEB994:6A50D4CC |
| html-safe-nonce | 790a80732d4a33bbae6f051800df32fda389a03243cc637d5b15143de7643062 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODJBOjEzOTcwODo0MkZGN0Y4OjVERUI5OTQ6NkE1MEQ0Q0MiLCJ2aXNpdG9yX2lkIjoiNDk5OTI2NjUzMTg4MTgzMzY3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4a7312cbb6bf70cb729cb8d57bf95efdfc84ea58a19145f2e77af3e770af4656 |
| hovercard-subject-tag | issue:2189209844 |
| 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/3276/issue_layout |
| twitter:image | https://opengraph.githubassets.com/960e2c3d18c4829ac7f9b7cf2ded2820d8ee7d36fe3c83fbf94e9385c4517aa4/sqlc-dev/sqlc/issues/3276 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/960e2c3d18c4829ac7f9b7cf2ded2820d8ee7d36fe3c83fbf94e9385c4517aa4/sqlc-dev/sqlc/issues/3276 |
| og:image:alt | What do you want to change? Currently, when a field is nullable and an enum, sqlc always generates a new type with a prefix Null. This Null___ type is a struct that wraps the enum's string alias ty... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nderscore |
| hostname | github.com |
| expected-hostname | github.com |
| None | 72b13e0e8d0319acdd27a145cfe73f4f06c791713d0ac4690e41fb68ad28cac0 |
| turbo-cache-control | no-preview |
| go-import | github.com/sqlc-dev/sqlc git https://github.com/sqlc-dev/sqlc.git |
| octolytics-dimension-user_id | 136738596 |
| octolytics-dimension-user_login | sqlc-dev |
| octolytics-dimension-repository_id | 193160679 |
| octolytics-dimension-repository_nwo | sqlc-dev/sqlc |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 193160679 |
| octolytics-dimension-repository_network_root_nwo | sqlc-dev/sqlc |
| 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 | 5bf72d88d55658ca72495ccb034c76af6c4c2feb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width