Closed
Description
Version
1.14.0
What happened?
Actually, NULLIF also smells bad. When using it in a query, the Go struct is generated with a field with a bool type, instead of a NullInt64 type.
Database schema
CREATE TABLE author (
id bigserial NOT NULL
);
SQL queries
-- name: GetRestrictedId :one
SELECT
NULLIF(id, $1) restricted_id
FROM
author;
Configuration
{
"version": "1",
"packages": [
{
"engine": "postgresql",
"path": "go",
"name": "querytest",
"schema": "query.sql",
"queries": "query.sql"
}
]
}
Playground URL
https://play.sqlc.dev/p/321eb83b945edfab5a41d8c91feb596bcab9860ce1780639d1f9863207a20644
What operating system are you using?
macOS
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
Originally posted by @euller88 in #92 (comment)