How to connect a LED G13 Tube directly to a power socket?
I have found a couple LED tubes that would be perfect for the task,


I highly doubt some G13 tubes are "perfect for the task". Especially if it has a frosted tube that will block half the photons. A clear tube can block 10% of the photons.



There are two main criteria when it comes to grow light LEDs, photons per watt and spectrum. 

Plants mostly like dark red (660 nm) and some dark blue (450 nm). 

  

Warm white (2700K) has more red than cool white (5000K).
High CRI (90+) has more red than low CRI (70).

Many growers will go for the cooler white because they a higher luminous efficacy (lm/W).  A quality 5000K LED may have 180 lm/W where a 2700K may have only 140 lm/W.  Plants do not care about lumens, only the number of photons.  A 2700K emits almost as many photons as the 5000K when the LED under the phosphor is the same LED in both light sources.  







2700K 97 CRI







The plant on the left is growing under 5700K the one on the right 3000K.  The one in the middle was planted about 1 week after the other two.  





For most photons per watt, I recommend the inexpensive Bridgelux EB Gen2 or the Samsung F-Series strips powered with a Mean Well HLG LED driver.

This is seven $7, 3000K Bridgelux BXEB-L0560Z-30E2000-C-B3 strips
Driven with a Mean Well HLG-240H-C1400B. 
You can find a DIY guide at LED Gardener. You do not need to mount the strips to an aluminum bar.  I just screw down the strips at the ends to the aluminum frame.  No heatsink was needed with the Bridgelux.  The Samsung you just reduce the current a little bit until the temperature is below 50°c.