Title: SQLite JSONB not coerced if type is capitalized. · Issue #4337 · sqlc-dev/sqlc · GitHub
Open Graph Title: SQLite JSONB not coerced if type is capitalized. · Issue #4337 · sqlc-dev/sqlc
X Title: SQLite JSONB not coerced if type is capitalized. · Issue #4337 · sqlc-dev/sqlc
Description: Version 1.30.0 What happened? #3968 introduced coercing a column to json if its type is jsonb. However, if the type is given as JSONB the coercion is not applied. With capitalized JSONB type const listSensors = `-- name: ListSensors :man...
Open Graph Description: Version 1.30.0 What happened? #3968 introduced coercing a column to json if its type is jsonb. However, if the type is given as JSONB the coercion is not applied. With capitalized JSONB type const ...
X Description: Version 1.30.0 What happened? #3968 introduced coercing a column to json if its type is jsonb. However, if the type is given as JSONB the coercion is not applied. With capitalized JSONB type const ...
Opengraph URL: https://github.com/sqlc-dev/sqlc/issues/4337
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SQLite JSONB not coerced if type is capitalized.","articleBody":"### Version\n\n1.30.0\n\n### What happened?\n\n#3968 introduced coercing a column to json if its type is jsonb. However, if the type is given as JSONB the coercion is not applied.\n\n**With capitalized `JSONB` type**\n```go\nconst listSensors = `-- name: ListSensors :many\nSELECT id, name, description, properties, created_at, updated_at, deleted_at, thing_id, feature_id FROM sensors WHERE deleted_at is NULL AND (CAST(?1 AS BOOLEAN) IS FALSE OR thing_id IN (/*SLICE:thing_ids*/?)) ORDER BY created_at\n`\n```\n\n**With uncapitalized `jsonb` type**\n```go\nconst listSensors = `-- name: ListSensors :many\nSELECT id, name, description, json(properties), created_at, updated_at, deleted_at, thing_id, feature_id FROM sensors WHERE deleted_at is NULL AND (CAST(?1 AS BOOLEAN) IS FALSE OR thing_id IN (/*SLICE:thing_ids*/?)) ORDER BY created_at\n`\n```\n\n### Relevant log output\n\n```shell\n\n```\n\n### Database schema\n\n```sql\nCREATE TABLE things (\n id INTEGER PRIMARY KEY NOT NULL,\n properties JSONB NOT NULL DEFAULT (JSONB('{}'))\n);\n\nCREATE TABLE things_2 (\n id INTEGER PRIMARY KEY NOT NULL,\n properties jsonb NOT NULL DEFAULT (jsonb('{}'))\n);\n```\n\n### SQL queries\n\n```sql\n-- name: ListThings :many\nselect * from things;\n\n-- name: ListThings2 :many\nselect * from things_2;\n```\n\n### Configuration\n\n```yaml\n\n```\n\n### Playground URL\n\n_No response_\n\n### What operating system are you using?\n\nLinux\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/TimVosch","@type":"Person","name":"TimVosch"},"datePublished":"2026-03-11T10:58:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/4337/sqlc/issues/4337"}
| 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:45942422-f84c-875c-2029-ff9ba0c2b3c7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D20:20C1D0:3E652A:53D0BA:6A514506 |
| html-safe-nonce | d5e408e609eb15d5939eef8709b9d6ba3568b6a564f452246c4a58cfc30650b5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDIwOjIwQzFEMDozRTY1MkE6NTNEMEJBOjZBNTE0NTA2IiwidmlzaXRvcl9pZCI6IjY4NjU4MTk5MzgxNjgzMjUzODIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | acc5a0fd191fb442fc52f193a4e9fd40147ec76304a606eff0707d7fc48d2d6b |
| hovercard-subject-tag | issue:4057493819 |
| 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/4337/issue_layout |
| twitter:image | https://opengraph.githubassets.com/514daffa8dbed228b1dbeae1e5163949236444e71cccf202f71fd65f2d9ebfe0/sqlc-dev/sqlc/issues/4337 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/514daffa8dbed228b1dbeae1e5163949236444e71cccf202f71fd65f2d9ebfe0/sqlc-dev/sqlc/issues/4337 |
| og:image:alt | Version 1.30.0 What happened? #3968 introduced coercing a column to json if its type is jsonb. However, if the type is given as JSONB the coercion is not applied. With capitalized JSONB type const ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | TimVosch |
| hostname | github.com |
| expected-hostname | github.com |
| None | e840f405b2718e8f2d55aafa9ff27dbce17e29d0c253011d05ea0fea3c78baff |
| 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 | b78565f6aa43cc5323c9935ec11b22cca7bb0a62 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width