summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--auth.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/auth.go b/auth.go
index 91ede99..cf27a91 100644
--- a/auth.go
+++ b/auth.go
@@ -215,6 +215,13 @@ func handleAuth(w http.ResponseWriter, req *http.Request) {
http.SetCookie(w, &cookie)
+ /*
+ * TODO: Here we attempt to insert and call update if we receive a
+ * conflict. This works but is not idiomatic (and could confuse the
+ * database administrator with database integrity warnings in the log.
+ * The INSERT statement actually supports updating on conflict:
+ * https://www.postgresql.org/docs/current/sql-insert.html
+ */
_, err = db.Exec(
req.Context(),
"INSERT INTO users (id, name, email, department, session, expr) VALUES ($1, $2, $3, $4, $5, $6)",