-
Notifications
You must be signed in to change notification settings - Fork 228
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
Operation translation for List<T> #395
Comments
@roji Has anyone started working on this? If not, I can start scoping out what we could translate in time for 2.1. |
Feel free to work on this, at least some things should be fairly easy. As a first goal it would be good to achieve party with what is already translated for arrays (length, indexing...) |
See some work done based on the old query pipeline in #541 |
* Match our List<T> translation capabilities to CLR array. * Improve some mapping and inference aspects. Closes #395
* Match our List<T> translation capabilities to CLR array. * Improve some mapping and inference aspects. Closes #395
* Match our List<T> translation capabilities to CLR array. * Improve some mapping and inference aspects. Closes #395
* Match our List<T> translation capabilities to CLR array. * Improve some mapping and inference aspects. Closes #395
* Match our List<T> translation capabilities to CLR array. * Improve some mapping and inference aspects. Closes #395
* Match our List<T> translation capabilities to CLR array. * Improve some mapping and inference aspects. Closes #395
Excuse me, does this mean that: var origins = new List<string> { origin };
var results = DB.Clients
.Where(Q => origins.All(item => Q.AllowedCorsOrigins.Contains(item)))
.AsNoTracking()
.AnyAsync(); Is now supported? (Will it translate to:) SELECT * FROM mytable WHERE myarray @> ARRAY['item']; |
@ryanelian yes, that should work - it's very similar to this test. Give it a try and please open a new issue if you run into trouble. |
Could someone confirm whether the following partial matching using Any and Contains is supported?
|
@JohnDitno take a look at #395 (comment). I'd recommend trying to reference 5.0.0-rc1 and giving it a try to be sure. |
@JohnDitno Unfortunately it does not work, at least in our case:
It does not matter if I used:
@ryanelian Should I open a new issue for that? |
@SommerEngineering thanks for responding to my query. That is a shame it doesn't seem to work still, hopefully it can be fixed as we have a similar scenario to your case. |
@SommerEngineering your query is very different from a simple Contains in a Where clause - can you please open a new issue? If Competencies is a list (or array) of string, are you searching whether one of its strings contains a specific character? Posting a full code sample (including your model) could help clarify what you're trying to do. |
Thanks @roji for your response. I created issue #1554 with a minimal repo to reproduce the case 🙂 @JohnDitno In my repo for issue #1554 you find different attempts to archive this functionality. No one works, if partial matching is necessary. Searching for exact matches in array columns works, though. This is might a workaround until we get the issue solved. |
We now support mapping CLR
List<T>
to PostgreSQL arrays (#392). We also have some nice operation translations for regular CLR arrays, but should also translate operations forList<T>
, which is supported for mapping PostgreSQL arrays.The text was updated successfully, but these errors were encountered: