title: Where should my SQL code go in MVC
body: <p>I'm just starting to learn the MVC design pattern, and I was wondering where should my SQL code go.</p>
  
  <p>For example, lets say I have a register form structure that looks like this</p>
  
  <pre><code>type Form struct {
   Username string
   Password string
  }
  </code></pre>
  
  <p>I assume that the form structure is part of the model, so I have some function that goes with the form that after a user submits the form, the data gets put into the database, so my function would look something like this</p>
  
  <pre><code>func (f *Form) registerUser() {
     // SQL code goes here
  }
  </code></pre>
  
  <p>Is this the best way of doing it? I have been searching around for open source Golang web apps that utilizes the MVC pattern, but I have not be able to find one which I completely understand. </p>