SqlBuilder where clause for "IN" operator throws exception for comma separated

634 views Asked by At

I'm adding a where clause to SqlBuilder that contains a "IN" operator and then assigning the parameter to a comma separated list of numbers. However, when select is called I get a PosgresException of {"42883: operator does not exist: integer = text"}.

SqlBuilder countBuilder = new SqlBuilder();
SqlBuilder.Template countTemplate = countBuilder.AddTemplate("select * from table /**where**/");

countBuilder.Where("id in (@ids)", new {ids = "1,2,3" });
var count = Db.Select<int>(countTemplate.RawSql, countTemplate.Parameters);
0

There are 0 answers