code: func (sb *SearchBuilder) ToSql() (string, []interface{}) {
  	sb.params = make([]interface{}, 0)
  
  	sb.buildSelect()
  
  	if len(sb.tags) > 0 {
  		sb.buildTagQuery()
  	} else {
  		sb.buildMainQuery()
  	}
  
  	sb.sql.WriteString(`
  		ORDER BY dashboard.id ` + dialect.LimitOffset(sb.limit, (sb.page-1)*sb.limit) + `) as ids
  		INNER JOIN dashboard on ids.id = dashboard.id
  	`)
  
  	sb.sql.WriteString(`
  		LEFT OUTER JOIN dashboard folder on folder.id = dashboard.folder_id
  		LEFT OUTER JOIN dashboard_tag on dashboard.id = dashboard_tag.dashboard_id`)
  
  	sb.sql.WriteString(" ORDER BY dashboard.title ASC")
  	return sb.sql.String(), sb.params
  }
docs: // ToSql builds the sql and returns it as a string, together with the params.