0.2.3 first actual database querry made :)

This commit is contained in:
Peder Vatn Austad
2024-05-25 21:48:53 +02:00
parent ae9e5ae247
commit 662ca02a7f
4 changed files with 356 additions and 14 deletions

View File

@@ -5,13 +5,10 @@ import (
"fmt"
)
func InsertServiceDelivery(db *sql.DB) (int, error) {
func InsertServiceDelivery(db *sql.DB, responseTimestamp string, recordedAtTime string) (int, error) {
fmt.Println("Inserting ServiceDelivery...")
var id int
responseTimestamp := "2024-05-25T10:24:29.353864654+02:00"
recordedAtTime := "2024-05-25T10:24:29.353864654+02:00"
err := db.QueryRow("INSERT INTO public.ServiceDelivery (ResponseTimestamp, RecordedAtTime) VALUES ($1, $2) RETURNING ID", responseTimestamp, recordedAtTime).Scan(&id)
fmt.Println(err)
if err != nil {