-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
c13070e
to
7e91612
Compare
Phase *types.Phase `json:"phase"` | ||
PhaseStartTime *time.Time `json:"phaseStartTime"` | ||
EventName *types.EventCode `json:"eventName"` | ||
EventTime *time.Time `json:"eventTime"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these all pointers because they are optional fields? Validation implementation suggests otherwise. Which leaves the question why pointers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I needed them to be pointers because I need to check if their values are nil to gaurd against missing properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am curious why not check for zero values?
event.EventTime, | ||
event.EventDetails, | ||
} | ||
_, err := r.db.Exec(ctx, query, values...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should do batch insertion here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried reading the docs and couldn't understand how to make that work. I agree though. I ended up here just to get something working.
7e91612
to
9c2b153
Compare
Description
Implements the
/v1/retrieval-events
handler.Demo
The demo spins up Postgres in Docker, runs the event recorder Docker container, creates the table in Postgres, POSTs to the container, and then views the event in Postgres via psql.
WindowsTerminal_QwplT41wEs.mp4