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
Support Guid ToString in SqLite, add test for mssql and sqlite #4297
base: master
Are you sure you want to change the base?
Conversation
Should I add "Guid.ToString" in Expressions.cs and create a Builder wich does nothing in Standard and in Sqlite I implement the logic. Same as I've done for TimeSpan in this: https://github.com/linq2db/linq2db/pull/3994/files#diff-0381ba7e238d0f1809d47075f54b06e6c5fb0dfd9c7f0ed1017188c0eab15e38 |
I'm a bit lost here. What you need to achieve? If you need guid.ToString mapping to SQL you should implement it in mappings (Expressions.cs probably). Another thing that looks incorrect is that proposed mapping generates upper-case guid. It is common to use lowercased guid string and default mapping should generate lowercased guid. |
I'd like to be able to use for example guid.ToString().Contains("aa") in LINQ. |
We already have it for other types. See |
1798fab
to
86eb267
Compare
@igor-tkachev |
/azp run test-all |
Azure Pipelines successfully started running 1 pipeline(s). |
Test baselines changed by this PR. Don't forget to merge/close baselines PR after this pr merged/closed. |
/azp run test-all |
Azure Pipelines successfully started running 1 pipeline(s). |
The test 3791 does not work for ClickHouse with this change ClickHouse.Client.ClickHouseServerException : Code: 53. DB::Exception: Can't infer common type for joined columns: OtherId: Nullable(String) at left, a_Association.Id: UUID at right. There is no supertype for types String, UUID because some of them are String/FixedString and some of them are not. (TYPE_MISMATCH) (version 23.12.2.59 (official build))
but for me it's not clear, when the convertExpression is used. Do I need to change smth. or need this to be fixed inside of linq2db? |
Is the ms.SetConvertExpression<Guid, string> used before my handling of ToSting in Expressions.cs? |
92c603c
to
da110d4
Compare
/azp run test-all |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run test-all |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run test-all |
Azure Pipelines successfully started running 1 pipeline(s). |
Test baselines changed by this PR. Don't forget to merge/close baselines PR after this pr merged/closed. |
all tests work, ready for review |
Co-authored-by: Stuart Turner <[email protected]>
/azp run test-all |
Azure Pipelines successfully started running 1 pipeline(s). |
Fix #4295