From 5209d81a012a34ed3129181ecb877feda11cf379 Mon Sep 17 00:00:00 2001 From: Emile Date: Sat, 16 Feb 2019 23:47:09 +0100 Subject: The insert star function now returns the starID of the inserted star --- db_actions.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db_actions.go b/db_actions.go index 59cadef..985ba6e 100644 --- a/db_actions.go +++ b/db_actions.go @@ -87,7 +87,7 @@ func NewTree(database *sql.DB, width float64) { } // insertStar inserts the given star into the stars table and the nodes table tree -func InsertStar(database *sql.DB, star structs.Star2D, index int64) { +func InsertStar(database *sql.DB, star structs.Star2D, index int64) int64 { db = database start := time.Now() @@ -117,6 +117,7 @@ func InsertStar(database *sql.DB, star structs.Star2D, index int64) { insertIntoTree(starID, id) elapsedTime := time.Since(start) log.Printf("\t\t\t\t\t %s", elapsedTime) + return starID } // insertIntoStars inserts the given star into the stars table -- cgit 1.4.1