-
Notifications
You must be signed in to change notification settings - Fork 968
Closed
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested
Description
Version
1.20.0
What happened?
I am using SQLC to generate Go code for my SQL queries. I have defined the following SQL statement:
-- name: GetUserDepositCountBetween :one
SELECT user_id, COUNT(*) AS deposit_count FROM transaction WHERE user_id = ? and type = 'deposit' and created_at >= sqlc.arg(start) AND created_at < sqlc.arg(end);When executing the generated Go code, I encounter an error if the user_id is not found in the database. The error message is:
"error":"sql: Scan error on column index 0, name \"user_id\": converting NULL to int64 is unsupported"
This makes it difficult for me to distinguish between a timeout error and a "record not found" error.
Relevant log output
error message: "error":"sql: Scan error on column index 0, name \"user_id\": converting NULL to int64 is unsupported"Database schema
No response
SQL queries
-- name: GetUserDepositCountBetween :one
SELECT user_id, COUNT(*) AS deposit_count FROM transaction WHERE user_id = ? and type = 'deposit' and created_at >= sqlc.arg(start) AND created_at < sqlc.arg(end);Configuration
No response
Playground URL
No response
What operating system are you using?
macOS
What database engines are you using?
MySQL
What type of code are you generating?
Go
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested