GibraltarSoftware / VistaDB.EFCore

Entity Framework Core provider for VistaDB 5 and later
MIT License
4 stars 0 forks source link

SELECT issue: Alternative to SYSDATETIMEOFFSET() ? #12

Closed ErikEJ closed 8 months ago

ErikEJ commented 6 years ago

SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[OrderDate] FROM [Orders] AS [o] WHERE [o].[OrderDate] = SYSDATETIMEOFFSET()

rparker-gibraltar commented 6 years ago

It looks like we currently only have GETDATE() and GETUTCDATE(), neither of which gives a DATETIMEOFFSET. We'll likely need to add the SYS... date/time functions for 6.0.

The only alternative I can see currently would be to get DateTimeOffset.Now in .NET and pass the value as a parameter. It might be handy to support this approach for our EFCore provider to work with 5.x versions. Or, we'd have to limit support to VistaDB 6 and later.

Is it possible for the provider to support both approaches and detect the VistaDB provider version to determine which approach to use?

ErikEJ commented 6 years ago

I would prefer 2 seperate provider packages, similar to what I do with Sqlce 3.5 Vs 4.0 (4.0 has paging support).

The way to tell EF Core that datetimeoffset.now must be evaluated on the client is to return Null from the function mapping (for v 5)

ErikEJ commented 6 years ago

Fixed for VistaDB v5 (by forcing client eval)

rparker-gibraltar commented 6 years ago

By the way, I'm working on adding SysDateTime() and SysDateTimeOffset() for a 5.7 release by the end of September. 5.7 will have a new assembly version to signify the support for this, and it will probably be the minimum version for EF Core support.