We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go-Building-Web-Applications/Module 1/Chapter 6/ch6-register-login.go
Line 78 in fd3512d
for example : if it's a new session, it should insert or else it should update
queryString := INSERT INTO sessions(session_id, user_id) SELECT $1::VARCHAR, $2 WHERE NOT EXISTS ( SELECT session_id FROM sessions where session_id = $1 )` _, err := database.Exec(queryString, sid, currUserId) checkErrorAndExit(err, "insert")
queryString :=
_, err = database.Exec("UPDATE sessions SET user_id = $2 where session_id = $1", sid, currUserId) checkErrorAndExit(err, "update")`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Go-Building-Web-Applications/Module 1/Chapter 6/ch6-register-login.go
Line 78 in fd3512d
for example :
if it's a new session, it should insert or else it should update
queryString :=
INSERT INTO sessions(session_id, user_id)SELECT $1::VARCHAR, $2
WHERE
NOT EXISTS (
SELECT session_id FROM sessions where session_id = $1
)`
_, err := database.Exec(queryString, sid, currUserId)
checkErrorAndExit(err, "insert")
The text was updated successfully, but these errors were encountered: