Re: Adding generated common table expressions

2022-05-10 Thread Gaga Ro
> *To:* Django developers (Contributions to Django itself) < > django-d...@googlegroups.com> > *Subject:* Re: Adding generated common table expressions > > > > Hello everyone, > > > > I'm often using django-cte and I'd be thrilled to have CTE in the core. > &

RE: Adding generated common table expressions

2022-05-10 Thread Matthew Pava
. From: django-developers@googlegroups.com On Behalf Of Gaga Ro Sent: Tuesday, May 10, 2022 9:01 AM To: Django developers (Contributions to Django itself) Subject: Re: Adding generated common table expressions Hello everyone, I'm often using django-cte and I'd be thrilled to have CTE

Re: Adding generated common table expressions

2022-05-10 Thread Gaga Ro
Hello everyone, I'm often using django-cte and I'd be thrilled to have CTE in the core. If I'm not mistaken, the only DB currently supported by Django and not having CTE support is MySQL 5.7 (with an end of life in October 2023). I don't know if Django 4.2 will support it, but it should be

Re: Adding generated common table expressions

2019-10-17 Thread Javier Buzzi
What do you think of this syntax instead? q1 = Book.objects.values('author_id').annotate(avg_price=Avg('price')) q2 = Author.objects.attach('book_prices', q1, id=F('book_prices__author_id' )) def attach(name, queryset, **params): # Would look something like this. ... Same sql output.

Re: Adding generated common table expressions

2019-07-22 Thread Jacob Rief
For my better understanding, could you please elaborate on what you mean by Hashes.as_literal(input_hashes) ? -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop

Re: Adding generated common table expressions

2017-11-29 Thread matthew.pava
I would like to know what the status of this is (adding CTE functionality to Django). It is supported by all current databases that Django supports. On Friday, March 17, 2017 at 6:49:39 PM UTC-5, Tim Graham wrote: > > Hi, I don't know anything about CTE, but did you see this third-party >

Re: Adding generated common table expressions

2017-04-06 Thread Anssi Kääriäinen
On Thursday, April 6, 2017 at 11:53:32 AM UTC+3, Marc Tamlyn wrote: > > Regarding Anssi's comments about SubQuery, we do now have that in core as > of 1.11 [0]. It does look like an .attach() approach might actually have > been a nicer version of this, but on the other hand it's currently >

Re: Adding generated common table expressions

2017-04-06 Thread Ashley Waite
Oh right, I feel silly for not thinking of named arguments as a resolution there, that's a damn good idea! It resolves a couple of minor issues I'd anticipated in a complete implementation, so consider the idea stolen! ;) I mean, ummm, that was totally what I had planned! - Ashley On

Re: Adding generated common table expressions

2017-04-06 Thread Marc Tamlyn
Hi! This looks generally very good, and I'm quite excited about it. In terms of taking it forwards, I think a DEP is a very good idea, and there are at least 3 core devs who are keen to see a solution. Whether you have the right solution yet I'm not so sure, but it sounds like you're not either.

Re: Adding generated common table expressions

2017-03-21 Thread Ashley Waite
Here's the code changes I've made, noting that some of them were to shove in a generalised VALUES clause that mocks being a queryset, so that it plays with the same interface. https://github.com/django/django/compare/master...ashleywaite:cte-dev#files_bucket I've had a glance at

Re: Adding generated common table expressions

2017-03-21 Thread Ashley Waite
CTE Forest is a specific use case of CTEs to store self-referential tree data sets. It's quite a different use to what I'm proposing, though its implementation might become simpler if Django is generally CTE aware. - Ashley On Saturday, March 18, 2017 at 6:59:57 PM UTC+11, Matthias Kestenholz

Re: Adding generated common table expressions

2017-03-21 Thread Ashley Waite
I'm nesting the query generators as they currently exist and adding awareness of that nesting into another compiler, so that queries that reference other models, contain annotations, etc should still in theory work fine. I do agree that the best method would be to generalise this to

Re: Adding generated common table expressions

2017-03-18 Thread Josh Smeaton
Thanks for bringing this up Ashley, and for all of the detail you provided. I'd certainly like to see CTEs make their way into Django, provided we could come up with a nice enough API. From the look of it, you've already got something that works with an okay API so I'm hopeful. I'd be very

Re: Adding generated common table expressions

2017-03-18 Thread Adam Johnson
> > supported is added in MySQL 8 [0] > Additionally MariaDB 10.2 supports them, and it's nearing release. On 18 March 2017 at 07:59, Matthias Kestenholz wrote: > Hi, > > On Sat, Mar 18, 2017 at 12:49 AM, Tim Graham wrote: > > Hi, I don't know anything

Re: Adding generated common table expressions

2017-03-18 Thread Matthias Kestenholz
Hi, On Sat, Mar 18, 2017 at 12:49 AM, Tim Graham wrote: > Hi, I don't know anything about CTE, but did you see this third-party > package? https://github.com/petrounias/django-cte-trees -- It seems to be > PostgreSQL only. Just chiming in to point out a maintained and

Re: Adding generated common table expressions

2017-03-17 Thread Tim Graham
Hi, I don't know anything about CTE, but did you see this third-party package? https://github.com/petrounias/django-cte-trees -- It seems to be PostgreSQL only. I was going to write, "Considering that not all databases support CTE (MySQL doesn't), a third-party app might be the way to go