Given the following function:
func (me *OrderService) GetOrders(orderTx *sql.Tx, orderId int) (orders *sql.Rows) {
orders, err := ecommTx.Query("SELECT * FROM orders WHERE id=?", orderId)
if err != nil {
log.Fatal(err)
}
log.Printf("Successfully queried and receive %d orders", orders.count)
return orders
}
Are there any easy ways to .count the results? I'd like to keep this database engine agonistic, but FWIW.... I'm using Matt N's sqlite3 driver for my integration tests, but plan on having a different DB in prod.