I think that it might be easiest to do with St_ShortestLine with PostGIS http://postgis.net/docs/ST_ShortestLine.html or with a similar ShortestLine function in Spatialite https://www.gaia-gis.it/gaia-sins/xmlBlob/spatialite-sql-latest.html.

You said you have only points but those functions can be used for other geometries as well.
Here is an example with Spatialite. 

    SELECT shortestline(a.geometry,b.geometry) AS geometry, 
    a.rowid AS start, b.rowid AS end 
    FROM source_table a, source_table b 
    WHERE a.rowid<b.rowid;

![enter image description here][1]


  [1]: https://i.sstatic.net/aGBll.png