title: Sqlmock is not matching the query when replace integer argument with alpha-numeric one
body: <p>I am trying to test my DB functions using <a href="https://github.com/DATA-DOG/go-sqlmock" rel="nofollow noreferrer">go-sqlmock</a> and I am not able make this one test pass.</p>
  <p>Here is my model</p>
  <pre><code>type User struct {
      ID            string `gorm:&quot;primaryKey; size:11&quot;`
      FirstName     string `gorm:&quot;NOT NULL; size:255&quot;`
      LastName      string `gorm:&quot;NOT NULL; size:255&quot;`
      Email         string `gorm:&quot;NOT NULL; UNIQUE_INDEX&quot;`
      Password      string `gorm:&quot;NOT NULL&quot;`
      CreatedAt     time.Time
      UpdatedAt     time.Time
      DeletedAt     *time.Time `sql:&quot;index&quot;`
  }
  </code></pre>
  <p>Here is my DB function</p>
  <pre><code>func (u *userRepo) GetByID(id string) (*user.User, AppError) {
      var user user.User
      if err := u.db.First(&amp;user, id).Error; err != nil {
          return nil, NewNotFoundError(err)
      }
      return &amp;user, nil
  }
  
  </code></pre>
  <p>I have two examples of tests, one is passing but the other does not. I am initializing sqlmock object like this</p>
  <pre><code>sqlmock.New(sqlmock.QueryMatcherOption(sqlmock.QueryMatcherEqual))
  </code></pre>
  <p>This one is working</p>
  <pre><code>t.Run(&quot;Get a user&quot;, func(t *testing.T) {
      expected := &amp;user.User{
          Email: &quot;alice@cc.cc&quot;,
      }
  
      u := NewUserRepo(gormDB)
  
      mock.
          ExpectQuery(
              `SELECT * FROM &quot;users&quot; WHERE &quot;users&quot;.&quot;deleted_at&quot; IS NULL AND ((&quot;users&quot;.&quot;id&quot; = $1)) ORDER BY &quot;users&quot;.&quot;id&quot; ASC LIMIT 1`).
          WithArgs(&quot;100&quot;).
          WillReturnRows(
              sqlmock.NewRows([]string{&quot;email&quot;}).
                  AddRow(&quot;alice@cc.cc&quot;))
  
      result, err := u.GetByID(&quot;100&quot;)
  
      assert.EqualValues(t, expected, result)
      assert.Nil(t, err)
  })
  </code></pre>
  <p>But this one is not working</p>
  <pre><code>t.Run(&quot;Get a user&quot;, func(t *testing.T) {
      expected := &amp;user.User{
          Email: &quot;alice@cc.cc&quot;,
      }
  
      u := NewUserRepo(gormDB)
  
      mock.
          ExpectQuery(
              `SELECT * FROM &quot;users&quot; WHERE &quot;users&quot;.&quot;deleted_at&quot; IS NULL AND ((&quot;users&quot;.&quot;id&quot; = $1)) ORDER BY &quot;users&quot;.&quot;id&quot; ASC LIMIT 1`).
          WithArgs(&quot;100a&quot;).
          WillReturnRows(
              sqlmock.NewRows([]string{&quot;email&quot;}).
                  AddRow(&quot;alice@cc.cc&quot;))
  
      result, err := u.GetByID(&quot;100a&quot;)
  
      assert.EqualValues(t, expected, result)
      assert.Nil(t, err)
  })
  </code></pre>
  <p>As you can see the only difference is I replace <code>100</code> by <code>100a</code> which I can do because the primary key is a string field.</p>
  <p>And this is the error I am getting</p>
  <pre><code>Query: actual sql: 
  &quot;SELECT * FROM &quot;users&quot; WHERE &quot;users&quot;.&quot;deleted_at&quot; IS NULL AND ((100a)) ORDER BY &quot;users&quot;.&quot;id&quot; ASC LIMIT 1&quot; 
  does not equal to expected 
  &quot;SELECT * FROM &quot;users&quot; WHERE &quot;users&quot;.&quot;deleted_at&quot; IS NULL AND ((&quot;users&quot;.&quot;id&quot; = $1)) ORDER BY &quot;users&quot;.&quot;id&quot; ASC LIMIT 1&quot; 
  </code></pre>
  <p>I don't know what I am doing wrong here, I even replaced the <code>$1</code> by <code>&quot;$1&quot;</code> which also didn't work. Any help would be great. Thanks.</p>