django icon indicating copy to clipboard operation
django copied to clipboard

Doc'd that Q expression order is preserved.

Open shangxiao opened this issue 6 months ago • 2 comments

This refs the closed ticket (do we #Refs wontfix tickets?) https://code.djangoproject.com/ticket/34964

I'm not really sure what we want to say here - Mariusz or Simon will have better phrasing - but I thought it might be prudent to at least say that:

Q(one=One, two=Two)

isn't necessarily preserved (I've been told the kwargs are sorted)

but:

Q(one=One) & Q(two=Two)

is preserved.

This is important for people that wish to control the expression order on databases that do preserve check constraint expressions for performance reasons.

Edit: I suppose not documenting this at all is also an option - perhaps this only really effects a niche group of people that use check constraints with performance implications!

shangxiao avatar Nov 16 '23 11:11 shangxiao

This is really tiny thing, important in really rare cases. I don't mind a short note, but adding a section with examples etc. sounds like overkill.

felixxm avatar Dec 18 '23 19:12 felixxm

This is really tiny thing, important in really rare cases. I don't mind a short note, but adding a section with examples etc. sounds like overkill.

I agree, I wasn't asking for a new section, I was suggesting we add a small example in the same admonition, just like the following note for Oracle has.

nessita avatar Dec 18 '23 19:12 nessita

@shangxiao Do you have time to keep working on this?

felixxm avatar Feb 28 '24 09:02 felixxm

@felixxm can do sorry this dropped off my radar.

So we just need an example? I can do that.

shangxiao avatar Feb 28 '24 09:02 shangxiao

@shangxiao Thanks :+1:

felixxm avatar Feb 28 '24 10:02 felixxm