Home > Backend Development > Golang > Why Am I Getting 'panic: sql: expected 1 destination arguments in Scan, not ' When Querying JSONB Data in Go?

Why Am I Getting 'panic: sql: expected 1 destination arguments in Scan, not ' When Querying JSONB Data in Go?

Susan Sarandon
Release: 2024-11-05 16:07:02
Original
1003 people have browsed it

Why Am I Getting

Error: "panic: sql: expected 1 destination arguments in Scan, not " in Go When Querying JSONB Data

When querying a PostgreSQL table with a JSONB column using db.QueryRow.Scan(), you may encounter the error "panic: sql: expected 1 destination arguments in Scan, not ." This error occurs when the number of destination arguments provided in Scan() does not match the number of fields returned by the query.

The code snippet provided using db.QueryRow is trying to scan three fields (Id, Type, `

The above is the detailed content of Why Am I Getting 'panic: sql: expected 1 destination arguments in Scan, not ' When Querying JSONB Data in Go?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template