Title: DEFAULT VALUES doesn't work on sqlite · Issue #3998 · sqlc-dev/sqlc · GitHub
Open Graph Title: DEFAULT VALUES doesn't work on sqlite · Issue #3998 · sqlc-dev/sqlc
X Title: DEFAULT VALUES doesn't work on sqlite · Issue #3998 · sqlc-dev/sqlc
Description: Version 1.29.0 What happened? I had a similar issue as #3781 trying to insert DEFAULT VALUES RETURNING id but getting the same failure as in that issue. To simplify and try to work around it, I removed the RETURNING clause and changed it...
Open Graph Description: Version 1.29.0 What happened? I had a similar issue as #3781 trying to insert DEFAULT VALUES RETURNING id but getting the same failure as in that issue. To simplify and try to work around it, I rem...
X Description: Version 1.29.0 What happened? I had a similar issue as #3781 trying to insert DEFAULT VALUES RETURNING id but getting the same failure as in that issue. To simplify and try to work around it, I rem...
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/3998
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"DEFAULT VALUES doesn't work on sqlite","articleBody":"### Version\n\n1.29.0\n\n### What happened?\n\nI had a similar issue as https://github.com/sqlc-dev/sqlc/issues/3781 trying to insert `DEFAULT VALUES RETURNING id` but getting the same failure as in that issue.\n\nTo simplify and try to work around it, I removed the `RETURNING` clause and changed it to `:exec`, but still got a similar error.\n\n### Relevant log output\n\n```shell\nline 8:22 no viable alternative at input 'workspace default'\n# package \ndb/queries/auth.sql:1:1: no viable alternative at input 'workspace default'\n```\n\n### Database schema\n\n```sql\ncreate table workspace(\n\tid integer primary key autoincrement\n);\n\ncreate table user(\n\tid integer primary key autoincrement,\n\tworkspace_id integer not null references workspace(id),\n\temail text not null,\n\tpasshash text\n);\ncreate unique index user_by_email on user(email);\n```\n\n### SQL queries\n\n```sql\n-- name: InsertWorkspace :exec\ninsert into workspace default values;\n```\n\n### Configuration\n\n```yaml\nversion: \"2\"\nsql:\n- schema: db/migrations\n queries: db/queries\n engine: sqlite\n gen:\n go:\n out: db\n```\n\n### Playground URL\n\n_No response_\n\n### What operating system are you using?\n\nmacOS\n\n### What database engines are you using?\n\nSQLite\n\n### What type of code are you generating?\n\nGo","author":{"url":"https://github.com/teepark","@type":"Person","name":"teepark"},"datePublished":"2025-06-21T16:01:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/3998/sqlc/issues/3998"}
| 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:ae440653-f903-5f1f-f26a-ddc8d8dad4e5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8A5E:243FE3:6F11C:94548:6A52BCC1 |
| html-safe-nonce | 7be0724f7578165849ae9f3796eef4f674e7177cdcfa247f6f71c679778e9890 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTVFOjI0M0ZFMzo2RjExQzo5NDU0ODo2QTUyQkNDMSIsInZpc2l0b3JfaWQiOiIyNzQxMDQxOTIzODYzMjY0NDUwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | cf144480f9377e11aae0dc99e7581a748055f46f5f63d3a4f4679bc8cdcae146 |
| hovercard-subject-tag | issue:3165192609 |
| 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/3998/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5a87074bae0ca5380a9c3cb83d673402ffbf19110e4a12eb2fc67987ebed5b21/sqlc-dev/sqlc/issues/3998 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5a87074bae0ca5380a9c3cb83d673402ffbf19110e4a12eb2fc67987ebed5b21/sqlc-dev/sqlc/issues/3998 |
| og:image:alt | Version 1.29.0 What happened? I had a similar issue as #3781 trying to insert DEFAULT VALUES RETURNING id but getting the same failure as in that issue. To simplify and try to work around it, I rem... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | teepark |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width