Generating start and end points for individual road segments
Using the virtual layer, you can compute both start and end point in a single row. Beware that your layer will now have 2 geometry fields, which are a pain to display (the 1st one is usually used)
SELECT From_id, st_startpoint(geometry) as geometryFrom,
To_id, st_endpoint(geometry) as geometryTO
FROM lineshp