querybuilder
querybuilder copied to clipboard
Wrong binding OrderByRaw with type of array
I'm try this query with playground. Array variable only get first index and variables after it use value of array.
Query
using SqlKata.Extensions;
var test1 = "test1";
var test2 = "test2";
var test3 = new int[]{1,2,3};
var query = new Query("Test")
.Select("test")
.OrderByRaw("Id = ? and test3 in (?) and test2=?",test1,test3,test2)
.Select("Id", "Name", "Url");
Result
SELECT * FROM "Test" ORDER BY Id = 'test1' and test3 in (1) and test2=2
I think it's because the array becomes flat
https://github.com/sqlkata/querybuilder/blob/d9d0441a8a1a27735e962d11fafd4bc4fc396ab4/QueryBuilder/Helper.cs#L27-L49
I think it's because the array becomes flat
https://github.com/sqlkata/querybuilder/blob/d9d0441a8a1a27735e962d11fafd4bc4fc396ab4/QueryBuilder/Helper.cs#L27-L49
I think so, too. Now I'm Join array to string split by ,
but I think this is also a bug need to fix