func RowsCount(db *sql.DB, table string) (int, error) {
	var rowsCount int
	rcQuery := fmt.Sprintf("SELECT COUNT(*) as count FROM %s", table)
	log.Debugf("About to fetch row count for %s", table)
	if err := db.QueryRow(rcQuery).Scan(&rowsCount); err != nil {
		return -1, fmt.Errorf(
			"failed to retrieve row count for table %s: %w",
			table,
			err,
		)
	}

	return rowsCount, nil
}
// RowsCount returns the number of rows for a specified table.
RowsCount returns the number of rows for a specified table.
// RowsCount returns the number of rows for a specified table .
func RowsCount(db *sql.DB, table string) (int, error) {
	var rowsCount int
	rcQuery := fmt.Sprintf("SELECT COUNT(*) as count FROM %s", table)
	log.Debugf("About to fetch row count for %s", table)
	if err := db.QueryRow(rcQuery).Scan(&rowsCount); err != nil {
		return -1, fmt.Errorf(
			"failed to retrieve row count for table %s: %w",
			table,
			err,
		)
	}
	return rowsCount, nil
}
func RowsCount ( db * sql . DB , table string ) ( int , error ) { var rowsCount int rcQuery := fmt . Sprintf ( " " , table ) log . Debugf ( " " , table ) if err := db . QueryRow ( rcQuery ) . Scan ( & rowsCount ) ; err != nil { return - 1 , fmt . Errorf ( " " , table , err , ) } return rowsCount , nil }
RowsCount returns the number of rows for a specified table.
RowsCount returns the number of rows for a specified table .