Which interface in the database/sql package is used to represent a database row?
- Entity
- Record
- Row
- Tuple
In the database/sql package of Go, the interface used to represent a database row is Row. This interface provides methods to scan column values into Go variables. When executing a SQL query that returns rows, you typically use the QueryRow() method to fetch a single row and then scan its values using the Scan() method of the Row interface. The Row interface abstracts the notion of a database row, making it easy to work with individual rows of query results.
Loading...
Related Quiz
- What is the size of the 'int' data type in Go on a 64-bit system?
- Implementing the _____ HTTP method is crucial for allowing clients to delete resources.
- To omit a field during JSON encoding in Go, you can use the ________ tag with a dash ("-").
- The "." (dot) operator in Go templating refers to the _______ data passed to the template.
- In MongoDB, what does BSON stand for?