Home  >  Article  >  Backend Development  >  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
Susan SarandonOriginal
2024-11-05 16:07:02920browse

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!

Statement:
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