Title: Add text column with default empty string value causes syntax error · Issue #3859 · sqlc-dev/sqlc · GitHub
Open Graph Title: Add text column with default empty string value causes syntax error · Issue #3859 · sqlc-dev/sqlc
X Title: Add text column with default empty string value causes syntax error · Issue #3859 · sqlc-dev/sqlc
Description: Version 1.27.0 What happened? Parsing DB migration file with setting the default value of a column to ('') causes a syntax error. It works without enclosing the single-quotes in parentheses, but this value does not work with the goose mi...
Open Graph Description: Version 1.27.0 What happened? Parsing DB migration file with setting the default value of a column to ('') causes a syntax error. It works without enclosing the single-quotes in parentheses, but th...
X Description: Version 1.27.0 What happened? Parsing DB migration file with setting the default value of a column to ('') causes a syntax error. It works without enclosing the single-quotes in parentheses...
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/3859
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add text column with default empty string value causes syntax error","articleBody":"### Version\n\n1.27.0\n\n### What happened?\n\nParsing DB migration file with setting the default value of a column to ('') causes a syntax error.\n\nIt works without enclosing the single-quotes in parentheses, but this value does not work with the goose migration tool\n\n### Relevant log output\n\n```shell\nsqlc generate failed.\n# package \nschema.sql:7:69: syntax error near \"'');\" \"\n```\n\n### Database schema\n\n```sql\nCREATE TABLE authors (\n id INT PRIMARY KEY,\n name text NOT NULL,\n bio text NOT NULL\n);\n```\n\n### SQL queries\n\n```sql\nALTER TABLE authors ADD COLUMN explanation text NOT NULL DEFAULT ('');\n```\n\n### Configuration\n\n```yaml\n{\n \"version\": \"2\",\n \"sql\": [{\n \"schema\": \"schema.sql\",\n \"queries\": \"query.sql\",\n \"engine\": \"mysql\",\n \"gen\": {\n \"go\": {\n \"out\": \"db\"\n }\n }\n }]\n}\n```\n\n### Playground URL\n\nhttps://play.sqlc.dev/p/3532b091fbc236e2c56c2eeb6a06ecc34ba3eb8deb833725b4b84f917c289bf5\n\n### What operating system are you using?\n\nmacOS\n\n### What database engines are you using?\n\nMySQL\n\n### What type of code are you generating?\n\nGo","author":{"url":"https://github.com/andylin-0","@type":"Person","name":"andylin-0"},"datePublished":"2025-02-24T18:38:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/3859/sqlc/issues/3859"}
| 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:1127e5c8-db40-b485-9f90-a40eb71df1ba |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E1D6:9C6CC:AD8063:F016D6:6A508C79 |
| html-safe-nonce | 3d1930bc7035d4de6c4b536e87a4d51a25de3d409d540feccd042b695063fe05 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMUQ2OjlDNkNDOkFEODA2MzpGMDE2RDY6NkE1MDhDNzkiLCJ2aXNpdG9yX2lkIjoiNTI1MTE5MTQxMjA0MTQ4NTQzNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f59438028169eabaf8d10015af8af21a5281d16e0411e3c37987e22d92f25f9e |
| hovercard-subject-tag | issue:2875842410 |
| 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/3859/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4deddea82910026ee52c7e4eb91a2d390439513bd1819b47f90d8d8c8d6142d8/sqlc-dev/sqlc/issues/3859 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4deddea82910026ee52c7e4eb91a2d390439513bd1819b47f90d8d8c8d6142d8/sqlc-dev/sqlc/issues/3859 |
| og:image:alt | Version 1.27.0 What happened? Parsing DB migration file with setting the default value of a column to ('') causes a syntax error. It works without enclosing the single-quotes in parentheses, but th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andylin-0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| 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 | 7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width