henkmollema / Dommel

CRUD operations with Dapper made simple.
MIT License
611 stars 99 forks source link

modulo in predicate is not working with sqlite connection #261

Closed ahmedsafan86 closed 1 year ago

ahmedsafan86 commented 3 years ago

.net core 5.0 Dommel, Version=2.3.0.0 the following line fail _dbConnection.SelectAsync(user => user.Id%2 == 0 )

With error Message: System.Data.SQLite.SQLiteException : SQL logic error near "MOD": syntax error Stack Trace: SQLite3.Prepare(SQLiteConnection cnn, String strSql, SQLiteStatement previous, UInt32 timeoutMS, String& strRemain) SQLiteCommand.BuildNextCommand() SQLiteCommand.GetStatement(Int32 index) SQLiteDataReader.NextResult() SQLiteDataReader.ctor(SQLiteCommand cmd, CommandBehavior behave) SQLiteCommand.ExecuteReader(CommandBehavior behavior) SQLiteCommand.ExecuteDbDataReader(CommandBehavior behavior) DbCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)

output sql is select * from Users where (Id MOD @p1 = @p2)

henkmollema commented 3 years ago

Can you try this again with version 2.3.2?