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

SQLite: Enable ef_compare for decimals #20035

Merged
merged 7 commits into from
Mar 3, 2020
Merged

SQLite: Enable ef_compare for decimals #20035

merged 7 commits into from
Mar 3, 2020

Conversation

lokalmatador
Copy link
Contributor

@lokalmatador lokalmatador commented Feb 23, 2020

Part of #19635

@dnfclas
Copy link

dnfclas commented Feb 23, 2020

CLA assistant check
All CLA requirements met.

@lokalmatador
Copy link
Contributor Author

@bricelam, so I went ahead and had a first look at the code (specifically your mentioned PR on datetime and the one on ef_mod) you and then just attempted to follow what I saw there, to somehow get an idea (monkey see, monkey do) of how ef_compare could work. The contents of this PR by no means provide a draft or anything close to that. But maybe they provide a basis for discussing the implementation.

What I wanted to ask before actually trying to work in an implementation

  • how would I add my own tests for driving my implementation?
  • is there some specification (or similar available) guiding test design?

I'll try to have a more thorough look at the code infrastructure next week, yet, any help/pointers would be greatly appreciated - thanks!

@bricelam
Copy link
Contributor

It looks like we already have some tests in test/EFCore.Sqlite.FunctionalTests/BuiltInDataTypesSqliteTest.cs. The comparison is done on the client, but if you enable a server translation, they'll verify that the result is still correct.

@lokalmatador
Copy link
Contributor Author

Thanks for the tips, I actually now got the tests running and see some errors. Gonna submit an updated over the weekend.

Code compiles but tests do not yet pass.
@bricelam bricelam changed the title WIP: SQLite: Enable ef_compare for decimals SQLite: Enable ef_compare for decimals Mar 3, 2020
@bricelam bricelam marked this pull request as ready for review March 3, 2020 18:02
@bricelam bricelam merged commit 940c1f6 into dotnet:master Mar 3, 2020
nullable: true,
new[] { true, true },
typeof(int));
var oracle = SqlExpressionFactory.Constant(value: 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is oracle!?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oracle: a person or thing regarded as an infallible authority or guide on something.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kind of like a sentinel but non-arbitrary and with canonical semantics

Copy link
Contributor Author

@lokalmatador lokalmatador Mar 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. The oracle predicts the expected result (which in this case is 0). But if desired, I'm happy to rename it to, e.g., expectedResult or sth similar.

@JonPSmith
Copy link

Hi @lokalmatador ,

Can I ask a question about what you are doing? I can't currently filter/order on a decimal in Sqlite database provider. Will your changes fix that?

@lokalmatador
Copy link
Contributor Author

Hi @JonPSmith ,
I'm currently working of various items in this list. As mentioned by @bricelam (if I got it correctly) , OrderBy won't be implemented for SQLite, yet I can't elaborate on why. For filtering, for now I do not think it's planned, but again, @bricelam probably better knows about that. I eventually just contribute code 😄

@JonPSmith
Copy link

Hi @lokalmatador,

Thanks for the update, and for your help in moving EF Core forward. Great stuff. I was asking as I'm working on some docs, so now I know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants