Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document SQLite client evaluation of decimals as a specific breaking change #1432

Closed
ajcvickers opened this issue Apr 15, 2019 · 6 comments
Closed
Assignees
Milestone

Comments

@ajcvickers
Copy link
Member

See dotnet/efcore#15324

@bricelam
Copy link
Contributor

Might also be worth mentioning DateTimeOffset, TimeSpan, and ulong too.

@bricelam
Copy link
Contributor

bricelam commented Apr 16, 2019

The operations we should block server-eval for:

Expression DateTime DateTimeOffset decimal TimeSpan* ulong
-x
x + y ❌*
x / y
x > y
x >= y
x < y
x <= y
x % y
x * y
x - y ❌*
xs.Average()
xs.Max()
xs.Min()
xs.OrderBy()
xs.Sum()

* We can make TimeSpan work by registering two UDFs. See bricelam/EFCore.SqliteEx#1

@ajcvickers
Copy link
Member Author

@bricelam What does a tick represent as opposed to an x?

Also, would it, theoretically, be possible to make all of these work (or at least all that are non-lossy) by registering functions that understood the mapping and did conversion back to the appropriate .NET type? If so, should we consider doing this automatically at least when using EF Core?

@bricelam
Copy link
Contributor

✔ - Works in SQL
❌ - Doesn't work
(blank) - No such operation

Yes, in theory, we could register UDFs for every operation and translate to them. But this is different from TimeSpan where we only need two UDFs to enable every operation.

Should we consider doing this automatically at least when using EF Core?

I don't like the idea of doing it automatically since our UDF names may collide with the application's. The TimeSpan issue mentions making it an opt-in part of the provider via optionsBuilder.UseSqlite(connection, x => x.UseTimeSpan())

@ajcvickers
Copy link
Member Author

Opt-in seems a good approach.

@bricelam
Copy link
Contributor

Added to docs here: https://docs.microsoft.com/en-us/ef/core/providers/sqlite/limitations#query-limitations
All invalid operations on these types are blocked in v3.
TimeSpan work tracked here: bricelam/EFCore.SqliteEx#1

@bricelam bricelam added this to the 3.0.0 milestone Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants