Awful incident OP....and very lucky.
I remember one event from my childhood, I was walking through a park with my uncle ( I was about 9) and his family dog (Jack Russell). He was leaded etc and although he was very yappy (all terriers are it seems) he was under control.
In the distance there was a German Shepherd running around playing fetch with its owner. The German Shepherd saw Tuffnell (name of the Jack Russell) and ran over and attacked him. I remember at the time thinking he was going to come over and play, but he literally came over and grabbed Tuffnell in his jaws and started shaking him.
My uncle was a mechanic, and he had a screwdriver on him (well this is his version!

) and took it out and stabbed the German Shepherd twice in its side with the screwdriver. The dog hit the floor.
On cue....one German Shepherd owner who did not see what my uncle did came over wondering why his dog was lying on the ground not moving.
As far as I can remember, the German Shepherd went to the vets and later died.
It seems brutal what my uncle did, but as a dog owner now of two very small toy dogs, if anything similar happened to mine, and I had a screwdriver on me, I would not hesitate to use it. I am not sure if that makes me some cold hearted dog killer, or someone just using extreme (perhaps over extreme) force to porotect my dogs.
In the case of Tuffnell he was fine after the event, a little bloody, but he overcame it and lived on for another 8 years. One thing is for sure though, if my uncle has not intervened that German Shepherd would have killed him.