René's URL Explorer Experiment


Title: feat: Generate DB unique constraints as enums by mafredri · Pull Request #3701 · coder/coder · GitHub

Open Graph Title: feat: Generate DB unique constraints as enums by mafredri · Pull Request #3701 · coder/coder

X Title: feat: Generate DB unique constraints as enums by mafredri · Pull Request #3701 · coder/coder

Description: This fixes a TODO from #3409. feat: Generate DB unique constraints as enums chore: Move dump to gen/dump, update Makefile I started out with a bash script, but ultimately I think writing this in Go will be more extensible in the future. For reference, Bash: # Generate unique constraint enums. cat <unique_constraint.go // Code generated by generate.sh. DO NOT EDIT. package database // UniqueConstraint represents a named unique constraint on a table. type UniqueConstraint string // UniqueConstraint enums. const ( EOF cat dump.sql | tr $'\n' ' ' | sed -e 's/\s\+/ /g' | tr ';' $'\n' | grep UNIQUE | while read -r line; do line=${line# } # Remove empty line at the beginnig. case "$line" in *"ALTER TABLE"*"ADD CONSTRAINT"*) name=$(awk '{print $7}' <<<"$line") ;; *"CREATE UNIQUE INDEX"*) name=$(awk '{print $4}' <<<"$line") ;; esac printf "\tUnique%s UniqueConstraint = \"%s\" // %s;" "$name" "$name" "$line" done >>unique_constraint.go echo ")" >>unique_constraint.go

Open Graph Description: This fixes a TODO from #3409. feat: Generate DB unique constraints as enums chore: Move dump to gen/dump, update Makefile I started out with a bash script, but ultimately I think writing this in ...

X Description: This fixes a TODO from #3409. feat: Generate DB unique constraints as enums chore: Move dump to gen/dump, update Makefile I started out with a bash script, but ultimately I think writing this in ...

Opengraph URL: https://github.com/coder/coder/pull/3701

X: @github

direct link

Domain: github.com

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:5b1d2caf-fc9f-3e7c-404a-e562438e06ee
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id805E:1F65:1CB9701:2484150:6B01B538
html-safe-nonceb40a0a6fddeeaa546cfe3b8d65d021c364281411a229ddcae8bb76b907cc6114
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDVFOjFGNjU6MUNCOTcwMToyNDg0MTUwOjZCMDFCNTM4IiwidmlzaXRvcl9pZCI6IjcyNTM4NjczOTMzNzc3MDI5NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac3c6615699fc66806cc2ec6c5cc314b6aa21e716e4393ddc5eccb97c304701ff6
hovercard-subject-tagpull_request:1037753293
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/coder/coder/pull/3701/files
twitter:imagehttps://avatars.githubusercontent.com/u/147409?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/147409?s=400&v=4
og:image:altThis fixes a TODO from #3409. feat: Generate DB unique constraints as enums chore: Move dump to gen/dump, update Makefile I started out with a bash script, but ultimately I think writing this in ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/coder/coder git https://github.com/coder/coder.git
octolytics-dimension-user_id95932066
octolytics-dimension-user_logincoder
octolytics-dimension-repository_id440752086
octolytics-dimension-repository_nwocoder/coder
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id440752086
octolytics-dimension-repository_network_root_nwocoder/coder
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
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

Links:

Skip to contenthttps://github.com/coder/coder/pull/3701/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcoder%2Fpull%2F3701%2Ffiles
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%2Fcoder%2Fcoder%2Fpull%2F3701%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=coder%2Fcoder
Reloadhttps://github.com/coder/coder/pull/3701/files
Reloadhttps://github.com/coder/coder/pull/3701/files
Reloadhttps://github.com/coder/coder/pull/3701/files
coderhttps://github.com/coder
coderhttps://github.com/coder/coder
Codehttps://github.com/coder/coder
Issues320 (320)https://github.com/coder/coder/issues
Pull requests470 (470)https://github.com/coder/coder/pulls
Discussionshttps://github.com/coder/coder/discussions
Actionshttps://github.com/coder/coder/actions
Projectshttps://github.com/coder/coder/projects
Security and quality49 (49)https://github.com/coder/coder/security
Insightshttps://github.com/coder/coder/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fcoder%2Fcoder%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fcoder%2Fcoder%2Fissues%2Fnew%2Fchoose
mafredrihttps://github.com/mafredri
mainhttps://github.com/coder/coder/tree/main
mafredri/gen-db-enumshttps://github.com/coder/coder/tree/mafredri/gen-db-enums
Conversation 2 https://github.com/coder/coder/pull/3701
Commits 6 https://github.com/coder/coder/pull/3701/commits
Checks 0 https://github.com/coder/coder/pull/3701/checks
Files changed https://github.com/coder/coder/pull/3701/files
Please reload this pagehttps://github.com/coder/coder/pull/3701/files
feat: Generate DB unique constraints as enums https://github.com/coder/coder/pull/3701/files#top
Show all changes 6 commits https://github.com/coder/coder/pull/3701/files
d32e9e8 feat: Generate DB unique constraints as enums mafredri Aug 26, 2022 https://github.com/coder/coder/pull/3701/commits/d32e9e8c9751c557ea7440fd9a51a73668dc481a
1ab885c chore: Move dump to gen/dump, update Makefile mafredri Aug 26, 2022 https://github.com/coder/coder/pull/3701/commits/1ab885c7372db8059b65477d7615d4ec313a442c
9f26394 fix: Renamed index mafredri Aug 26, 2022 https://github.com/coder/coder/pull/3701/commits/9f263949bd1e24570fe43a1eeb4319e0ec8be173
27adb55 fix: Consistency mafredri Aug 26, 2022 https://github.com/coder/coder/pull/3701/commits/27adb558b119356eb8f0e6b13d07ef375b5e6c9d
23fd378 Cleanup mafredri Aug 26, 2022 https://github.com/coder/coder/pull/3701/commits/23fd378485ccbd7336b56008fa8a52e8fde86357
9a7c833 Fix makefile mafredri Aug 26, 2022 https://github.com/coder/coder/pull/3701/commits/9a7c833b91a53f25e5031a2ad05e5a795807a28c
Clear filters https://github.com/coder/coder/pull/3701/files
Please reload this pagehttps://github.com/coder/coder/pull/3701/files
Please reload this pagehttps://github.com/coder/coder/pull/3701/files
Makefile https://github.com/coder/coder/pull/3701/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52
errors.go https://github.com/coder/coder/pull/3701/files#diff-70f5206ed363647433c1b3d656beba91f64c9f515aa3069aec64d0490f806cb6
main.go https://github.com/coder/coder/pull/3701/files#diff-60c018bee299b7a04c5264ca585416e56bcd8e611f1e1815014f90b59e523eee
main.go https://github.com/coder/coder/pull/3701/files#diff-aa84d52c8e926ce76477627f4e1df104ccf8116e25ed33522c284bf2fb2509b8
generate.sh https://github.com/coder/coder/pull/3701/files#diff-e664c197fe3d3fc930b0158b881c7b6754721d97f83cf29fb469174074d3e871
unique_constraint.go https://github.com/coder/coder/pull/3701/files#diff-da1b3551c62961caecff935493fc06684feac62688d55691e87f870ff8ccfc0d
workspaces.go https://github.com/coder/coder/pull/3701/files#diff-46f90baab52ea3ad914acbde30d656dbc8e46f5918d19bc056c445a1dc502482
Makefilehttps://github.com/coder/coder/pull/3701/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52
View file https://github.com/coder/coder/blob/9a7c833b91a53f25e5031a2ad05e5a795807a28c/Makefile
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/coder/pull/3701/{{ revealButtonHref }}
https://github.com/coder/coder/pull/3701/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52
https://github.com/coder/coder/pull/3701/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52
coderd/database/errors.gohttps://github.com/coder/coder/pull/3701/files#diff-70f5206ed363647433c1b3d656beba91f64c9f515aa3069aec64d0490f806cb6
View file https://github.com/coder/coder/blob/9a7c833b91a53f25e5031a2ad05e5a795807a28c/coderd/database/errors.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/coder/pull/3701/{{ revealButtonHref }}
https://github.com/coder/coder/pull/3701/files#diff-70f5206ed363647433c1b3d656beba91f64c9f515aa3069aec64d0490f806cb6
https://github.com/coder/coder/pull/3701/files#diff-70f5206ed363647433c1b3d656beba91f64c9f515aa3069aec64d0490f806cb6
coderd/database/dump/main.go → coderd/database/gen/dump/main.gohttps://github.com/coder/coder/pull/3701/files#diff-60c018bee299b7a04c5264ca585416e56bcd8e611f1e1815014f90b59e523eee
View file https://github.com/coder/coder/blob/9a7c833b91a53f25e5031a2ad05e5a795807a28c/coderd/database/gen/dump/main.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/coder/pull/3701/{{ revealButtonHref }}
https://github.com/coder/coder/pull/3701/files#diff-60c018bee299b7a04c5264ca585416e56bcd8e611f1e1815014f90b59e523eee
https://github.com/coder/coder/pull/3701/files#diff-60c018bee299b7a04c5264ca585416e56bcd8e611f1e1815014f90b59e523eee
coderd/database/gen/enum/main.gohttps://github.com/coder/coder/pull/3701/files#diff-aa84d52c8e926ce76477627f4e1df104ccf8116e25ed33522c284bf2fb2509b8
View file https://github.com/coder/coder/blob/9a7c833b91a53f25e5031a2ad05e5a795807a28c/coderd/database/gen/enum/main.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/coder/pull/3701/{{ revealButtonHref }}
coderd/database/generate.shhttps://github.com/coder/coder/pull/3701/files#diff-e664c197fe3d3fc930b0158b881c7b6754721d97f83cf29fb469174074d3e871
View file https://github.com/coder/coder/blob/9a7c833b91a53f25e5031a2ad05e5a795807a28c/coderd/database/generate.sh
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/coder/pull/3701/{{ revealButtonHref }}
https://github.com/coder/coder/pull/3701/files#diff-e664c197fe3d3fc930b0158b881c7b6754721d97f83cf29fb469174074d3e871
https://github.com/coder/coder/pull/3701/files#diff-e664c197fe3d3fc930b0158b881c7b6754721d97f83cf29fb469174074d3e871
https://github.com/coder/coder/pull/3701/files#diff-e664c197fe3d3fc930b0158b881c7b6754721d97f83cf29fb469174074d3e871
coderd/database/unique_constraint.gohttps://github.com/coder/coder/pull/3701/files#diff-da1b3551c62961caecff935493fc06684feac62688d55691e87f870ff8ccfc0d
View file https://github.com/coder/coder/blob/9a7c833b91a53f25e5031a2ad05e5a795807a28c/coderd/database/unique_constraint.go
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/coder/coder/pull/3701/files
coderd/workspaces.gohttps://github.com/coder/coder/pull/3701/files#diff-46f90baab52ea3ad914acbde30d656dbc8e46f5918d19bc056c445a1dc502482
View file https://github.com/coder/coder/blob/9a7c833b91a53f25e5031a2ad05e5a795807a28c/coderd/workspaces.go
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/coder/pull/3701/{{ revealButtonHref }}
https://github.com/coder/coder/pull/3701/files#diff-46f90baab52ea3ad914acbde30d656dbc8e46f5918d19bc056c445a1dc502482
https://github.com/coder/coder/pull/3701/files#diff-46f90baab52ea3ad914acbde30d656dbc8e46f5918d19bc056c445a1dc502482
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.