First of all there is no solanine in green tomato, there wasn't, and there never will be.
Steroidal glycoalkaloids (SGAs) extracted from tomato leaves and
berries (Lycopersicon esculentum Mill.) were separated and identified
using optimized reversed-phase liquid chromatography with electrospray
ionization (ESI) and ion trap mass spectrometry (ITMS). The ESI source
polarity and chromatographic conditions were evaluated. The ESI
spectra contain valuable information, which includes the mass of SGAs,
the mass of the aglycones, and several characteristic fragment ions.
Cleavage at the interglycosidic bonds proximal to the aglycones is the
most prominent process in the ESI process. A protonated molecule,
[M+H]+, accompanied by a mixed adduct ion, [M+H+Na]2+, was observed
for α-tomatine (i.e., m/z 1034.7 and 528.9) and dehydrotomatine (i.e.,
m/z 1032.6 and 527.9) in positive ion mode spectra. The structures of
these tomato glycoalkaloids were confirmed using tandem mass
spectrometry. The identification of a new α-tomatine isomer
glycoalkaloid, named filotomatine (MW 1033), which shares a common
tetrasaccharide structure (i.e., lycotretraose) with α-tomatine and
dehydrotomatine, and soladulcidine as an aglycone, is described for
the first time. It occurs in significant amounts in the extracts of
wild tomato foliage. Multistage mass spectrometry both of the
protonated molecules and of the doubly charged ions was used for
detailed structural elucidation of SGAs. Key fragmentations and
regularities in fragmentation pathways are described and the
fragmentation mechanisms involved are proposed.
Your bitter nightshade really has solanine content:
Alkaloids are well known for their antimicrobial activity. Though all
natural alkaloids come from plants, not all plants produce alkaloids.
Plants of the Solanaceae family are known for their high alkaloid
content. Alkaloids are found in all plant parts like roots, stems,
leaves, flowers, fruits and seeds. In the present study, those plant
parts of Solanum dulcamara were selected which have been reported to
produce a high content of a specific alkaloid: solanine (from unripe
fruits), solasodine (from flowers) and β-solamarine (from roots).
These alkaloids were extracted from various parts of S. dulcamara by
well-established methods and were screened for their antibacterial
activity. Human pathogenic bacteria, viz., Enterobacter aerogenes,
Escherichia coli, Staphylococcus aureus, were selected for the study.
All three alkaloids inhibited the growth of E. coli and S. aureus.
However, no significant activity was observed against E. aerogenes.
Minimum inhibitory concentration and minimum bactericidal
concentration were also evaluated.
The glycoalkaloid content usually decrease by ripening, so that the animals can eat them safely and deliver the seeds. At least that's my observation. So there is a good chance that the ripe fruits are edible...
If they are not, it is hard to get rid of the solanine. Solanine is heat stable it decomposes over 200°C (about 240-260°C afaik) and it is not (poorly) water soluble. So cooking in hot water does not help.
Reduction in concentration of α-chaconine (CHA) and α-solanine (SOL),
toxic glycoalkaloids in potatoes, during cooking by 3 procedures was
investigated. Raw or cooked potato samples (2 g) were extracted twice
with 5% acetic acid solution. The extract was purified on Sep-Pak C18
and CHA and SOL contents were determined by HPLC. Recoveries of CHA
and SOL from raw potatoes were 96.5 and 98.2%, respectively, vs. 96.2
and 96.7% from cooked potatoes. >93.9% of CHA and 95.9% of SOL
remained in potatoes after boiling. Contents of both were reduced by
15% on microwave treatment. On deep-frying alkaloid contents varied
according to temperature. At 157°C, both alkaloids were unaffected; at
170°, potatoes showed a large variation in residual alkaloids. At
210°, alkaloids were partially decomposed; after 10 min heating, 64.9%
of CHA and 59.7% of SOL remained. It is suggested that the critical
temperature for decomposition of both alkaloids in potatoes may be
around 170°. Results confirmed the relatively high stability of CHA
and SOL in potatoes under normal home cooking conditions.
Deep frying over 200 °C might help, because it degrades the glycoalkaloids and probably moves them from the fruits to the oil, but be aware that this is an old article... Teflon will burn over 270°C afaik, and you should check the smoke point of the oil, because most of them have in a range of 150°C to 250°C. I guess there are other methods which I don't know of, but I think you don't want to eat that pie... ;-)