You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I call IQueryable.First() or IQueryable.Last(), I get the exception [SQLite Error 1: 'near "FETCH": syntax error'].
When I look at the debug view on the IQueryable object before calling First() or Last() there is no "FETCH" in the SQL query, so First() and Last() must be adding this.
When I remove this package from my project this behaviour goes away.
The text was updated successfully, but these errors were encountered:
AdamIzon
changed the title
Breaks Sqlite provider
First() and Last() methods break in Sqlite provider
Jan 19, 2025
var blockades = _dbContext.Blockade;
var testQuery = blockades.Select(b => EF.Functions.RowNumber(EF.Functions.Over().OrderBy((long)b.BlockadeStartIndex)));
var average = testQuery.First();
The SQL code being generated is
SELECT ROW_NUMBER() OVER(ORDER BY CAST("b"."BlockadeStartIndex" AS INTEGER))
FROM "Blockade" AS "b"
WHERE "b"."RecordingId" = @__recording_Id_0
ORDER BY CAST("b"."BlockadeStartIndex" AS INTEGER)
FETCH FIRST 1 ROWS ONLY
but to clarify, this breaks any call to IQueryable.First()... not just queries containing window functions
When I call IQueryable.First() or IQueryable.Last(), I get the exception [SQLite Error 1: 'near "FETCH": syntax error'].
When I look at the debug view on the IQueryable object before calling First() or Last() there is no "FETCH" in the SQL query, so First() and Last() must be adding this.
When I remove this package from my project this behaviour goes away.
The text was updated successfully, but these errors were encountered: