René's URL Explorer Experiment


Title: proposal: Configurable Post Processors · Issue #1725 · sqlc-dev/sqlc · GitHub

Open Graph Title: proposal: Configurable Post Processors · Issue #1725 · sqlc-dev/sqlc

X Title: proposal: Configurable Post Processors · Issue #1725 · sqlc-dev/sqlc

Description: What do you want to change? This idea comes from various open and closed issues. Most recently #1485 (which I jumped in at the last minute to help push over the finish line). The idea is simple - the implemetation probably not so much. S...

Open Graph Description: What do you want to change? This idea comes from various open and closed issues. Most recently #1485 (which I jumped in at the last minute to help push over the finish line). The idea is simple - t...

X Description: What do you want to change? This idea comes from various open and closed issues. Most recently #1485 (which I jumped in at the last minute to help push over the finish line). The idea is simple - t...

Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/1725

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"proposal: Configurable Post Processors","articleBody":"### What do you want to change?\r\n\r\nThis idea comes from various open and closed issues. Most recently #1485 (which I jumped in at the last minute to help push over the finish line).\r\n\r\nThe idea is simple - the implemetation probably not so much. So, I was hoping to open an Issue to put forth the proposal and flesh out the idea before venturing into implementation.\r\n\r\n---\r\n\r\n**Proposal**: An extension to the configuration that allows for running arbitrary post-processors against generated code.\r\n\r\nThis could take one of two forms in my head:\r\n\r\n- Simple stdin/stdout approach : Where essentially the input could be passed as stdin to some arbitrary command string and the output replaced with whatever it produces on its stdout. \r\n\r\nThis method would probably be pretty easy to implement (relatively speaking), but would come with limitations that I'll expand on in the second approach.\r\n\r\n- A plugin model built around a public interface in the code. Ideally with support for third-party plugins (perhaps via an RPC interface such as used in Hashicorp Vault), but that wouldn't be as crucial out of the gate. The interface could look something like (pseudo-code)\r\n\r\n```go\r\ntype PostProcessor interface {\r\n    Render(Context) (io.ReadCloser, error)\r\n}\r\n```\r\n\r\nWhere the `Context` contains AST information and other metadata for the file being rendered. A built-in reference implementation could be a simple search/replace and/or type override. A custom plugin could have satisfied the NullableEnum issue until support was included upstream. This makes things much more flexible for the post-processor and runs into far fewer limitations.\r\n\r\nIf you are open to either of these proposals, I'm happy to help see them to reality. I feel like this would end up having considerable overlap with some of the existing functionality regarding the child directives in the `gen` config. But perhaps there is a way for it to fit into that paradigm as well, and then some of those directives could be implemented as going through a chain of \"Post Processors\".\r\n\r\n---\r\n\r\nSome additional context regarding this idea. One thing I've done for an internal project (though this may become open source) is a post-processor (that has to be invoked after sqlc) that generates most of a GraphQL schema from the generated code using  \r\n https://github.com/graphql-go/graphql.\r\n\r\nOne of the pain points in that generator, is it has to effectively rebuild its own Go AST by parsing the sqlc output. If a plugin interface like described above existed, the implementation would be much cleaner.\r\n\r\n### What database engines need to be changed?\r\n\r\nPostgreSQL, MySQL\r\n\r\n### What programming language backends need to be changed?\r\n\r\nGo, Python, Kotlin","author":{"url":"https://github.com/tinyzimmer","@type":"Person","name":"tinyzimmer"},"datePublished":"2022-07-06T00:51:43Z","url":"https://github.com/sqlc-dev/sqlc/issues/1725"}

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:527925d8-b3e1-c071-ac1e-a5f8a9d3d8b3
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAF54:DA744:1E87D91:290945C:6B01805F
html-safe-nonce4c27a7e4c50f2edf8add74eeda00a70dbb2a34c8127354f22e1630ae6bfdb467
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjU0OkRBNzQ0OjFFODdEOTE6MjkwOTQ1Qzo2QjAxODA1RiIsInZpc2l0b3JfaWQiOiI4MjYzODA0OTcwOTU3MTExMzkxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac4041dd0defa6065024a3033714f4317cc86d5cdfcfea2a0f2bd712a1a0a31462
hovercard-subject-tagissue:1294947793
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/sqlc-dev/sqlc/1725/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9549d61f860f14629fd37c6c1cf921504937f677a4de4b059e507b2b5f0dcdcb/sqlc-dev/sqlc/issues/1725
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9549d61f860f14629fd37c6c1cf921504937f677a4de4b059e507b2b5f0dcdcb/sqlc-dev/sqlc/issues/1725
og:image:altWhat do you want to change? This idea comes from various open and closed issues. Most recently #1485 (which I jumped in at the last minute to help push over the finish line). The idea is simple - t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametinyzimmer
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
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
disable-turbofalse
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
react-app-nameissues

Links:

Skip to contenthttps://github.com/sqlc-dev/sqlc/issues/1725#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsqlc-dev%2Fsqlc%2Fissues%2F1725
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%2Fissues%2F1725
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=sqlc-dev%2Fsqlc
Reloadhttps://github.com/sqlc-dev/sqlc/issues/1725
Reloadhttps://github.com/sqlc-dev/sqlc/issues/1725
Reloadhttps://github.com/sqlc-dev/sqlc/issues/1725
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
https://github.com/sqlc-dev/sqlc
New issuehttps://github.com/login?return_to=https://github.com/sqlc-dev/sqlc/issues/1725
New issuehttps://github.com/login?return_to=https://github.com/sqlc-dev/sqlc/issues/1725
proposal: Configurable Post Processorshttps://github.com/sqlc-dev/sqlc/issues/1725#top
enhancementNew feature or requesthttps://github.com/sqlc-dev/sqlc/issues?q=state%3Aopen%20label%3A%22enhancement%22
proposalhttps://github.com/sqlc-dev/sqlc/issues?q=state%3Aopen%20label%3A%22proposal%22
triageNew issues that hasn't been reviewedhttps://github.com/sqlc-dev/sqlc/issues?q=state%3Aopen%20label%3A%22triage%22
https://github.com/tinyzimmer
tinyzimmerhttps://github.com/tinyzimmer
on Jul 6, 2022https://github.com/sqlc-dev/sqlc/issues/1725#issue-1294947793
#1485https://github.com/sqlc-dev/sqlc/pull/1485
https://github.com/graphql-go/graphqlhttps://github.com/graphql-go/graphql
tinyzimmerhttps://github.com/tinyzimmer
enhancementNew feature or requesthttps://github.com/sqlc-dev/sqlc/issues?q=state%3Aopen%20label%3A%22enhancement%22
triageNew issues that hasn't been reviewedhttps://github.com/sqlc-dev/sqlc/issues?q=state%3Aopen%20label%3A%22triage%22
on Jul 6, 2022https://github.com/sqlc-dev/sqlc/issues/1725#event-6938428769
kyleconroyhttps://github.com/kyleconroy
proposalhttps://github.com/sqlc-dev/sqlc/issues?q=state%3Aopen%20label%3A%22proposal%22
on Jul 10, 2022https://github.com/sqlc-dev/sqlc/issues/1725#event-6964641716
https://github.com/kyleconroy
kyleconroyhttps://github.com/kyleconroy
on Jul 10, 2022https://github.com/sqlc-dev/sqlc/issues/1725#issuecomment-1179659792
#1684https://github.com/sqlc-dev/sqlc/pull/1684
#1578https://github.com/sqlc-dev/sqlc/pull/1578
kyleconroyhttps://github.com/kyleconroy
completedhttps://github.com/sqlc-dev/sqlc/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Aug 28, 2022https://github.com/sqlc-dev/sqlc/issues/1725#event-7273734558
Sign up for freehttps://github.com/signup?return_to=https://github.com/sqlc-dev/sqlc/issues/1725
Sign in to commenthttps://github.com/login?return_to=https://github.com/sqlc-dev/sqlc/issues/1725
enhancementNew feature or requesthttps://github.com/sqlc-dev/sqlc/issues?q=state%3Aopen%20label%3A%22enhancement%22
proposalhttps://github.com/sqlc-dev/sqlc/issues?q=state%3Aopen%20label%3A%22proposal%22
triageNew issues that hasn't been reviewedhttps://github.com/sqlc-dev/sqlc/issues?q=state%3Aopen%20label%3A%22triage%22
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.