github.com/mailru/activerecord@v1.12.2/pkg/tarantool/sqlbuilder.go (about)

     1  package tarantool
     2  
     3  import "strings"
     4  
     5  func BuildSQLPredicateIN(fieldname string, fieldCndt int) string {
     6  	if fieldCndt == 0 {
     7  		return ""
     8  	}
     9  
    10  	var b strings.Builder
    11  	b.Grow(len(fieldname) + 2*fieldCndt + 10)
    12  	b.WriteString(" \"" + fieldname + "\" IN (?")
    13  
    14  	for i := 0; i < fieldCndt-1; i++ {
    15  		b.WriteString(", ?")
    16  	}
    17  
    18  	b.WriteString(")")
    19  
    20  	return b.String()
    21  }