-
-
Notifications
You must be signed in to change notification settings - Fork 519
Description
Hi I'm using SqlKata v2.2.0 (no execution package) in Unity 2019.3.14f1 on a Mac. I have the 'Api Compatibility Level' configured at .NET 4.x.
Whenever I try and compile a query with a WHERE statement it doesn't inject the values into the query when I retrieve it as an SQL string.
Using the same(ish) code from the default playground scenario:
MySqlCompiler compiler = new MySqlCompiler();
var query = new Query("Users")
.Where("Name", "Sami")
.Where(q =>
q.Where("Country", "Lebanon")
.OrWhere("Country", "France")
);
print(compiler.Compile(query).Sql);
I get the result:
SELECT * FROM "Users" WHERE "Name" = @p0 AND ("Country" = @p1 OR "Country" = @p2)
I'm using the SQLite compiler but it also happens for the others:
SQLServer: SELECT * FROM [Users] WHERE [Name] = @p0 AND ([Country] = @p1 OR [Country] = @p2)
MySQL: SELECT * FROM 'Users' WHERE 'Name' = @p0 AND ('Country' = @p1 OR 'Country' = @p2)
I've tried this on other queries and get a similar result:
SELECT * FROM "ConsumableData" INNER JOIN "ItemData" ON "ConsumableData"."ID" = "ItemData"."ID" WHERE "ConsumableData"."ID" = @p0
RawSql works, all of the @pXs come up as ?. I'd rather be able to use the package like it's intended however.
Any thoughts on this?