Preheat oven to 350 degrees. Generously butter a 9-by-13-inch baking dish, and set aside. Bring a large pot of water to a boil; add salt and spaghetti. Cook according to package directions until pasta is al dente. Transfer to a colander, and drain.
Meanwhile, heat oil in a large saute pan over medium heat. Add onion; cook, stirring occasionally, until it is translucent, about 5 minutes. Add sausage, and cook, stirring frequently, until sausage is browned and cooked through, 5 to 10 minutes. Remove from heat; transfer mixture to a large bowl, reserving saute pan.
Add peas and the cooked spaghetti to sausage mixture. Pour heavy cream into reserved saute pan; deglaze pan over medium-high heat by stirring up any browned bits from bottom of pan with a wooden spoon. Remove from heat, and stir cream into spaghetti mixture.
In another large bowl, whisk together eggs and ricotta cheese; season with salt and pepper. Stir egg mixture into spaghetti mixture, and transfer to prepared baking dish. Place in oven, and bake until top is lightly browned and center is set, about 45 minutes. Remove from oven, and let rest a few minutes. Cut into squares, and serve.