You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@coatsd and I reviewed the usage of db.Prepare in the user service query code, and we found one instance of it. It was used for inserting user_id and role_id into the join table called user_role.
According to the the tutorial section "Modifying Data and Using Transactions" in the Go Database/SQL Tutorials site, for executing statements that do not return data, such as INSERT statements, using db.Prepare is preferred.
The other option is to use Exec without db.Prepare. However, because we repeatedly use the prepared statement to insert data into user_role in a for loop, it would be beneficial to have a prepared statement use in a loop.
I'll close this issue as the db.Prepare seems to be the most appropriate way of making the aforementioned query.
Spawning from #74
The text was updated successfully, but these errors were encountered: