Re: Proposal for an "Age" PostgreSQL ORM function

2023-01-24 Thread Jörg Breitbart
Am 21.01.23 um 10:53 schrieb 'Adam Johnson' via Django developers (Contributions to Django itself): A Django wrapper would actually be more complicated. You’d need to understand both the PostgreSQL and Django function docs, and you might not be sure Django does anything special besides call

Re: Proposal for an "Age" PostgreSQL ORM function

2023-01-21 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
+1 to what Carlton said. You can make this function in your project like so: class Age(Func): function = "AGE" A Django wrapper would actually be more complicated. You’d need to understand both the PostgreSQL and Django function docs, and you might not be sure Django does anything special bes

Re: Proposal for an "Age" PostgreSQL ORM function

2023-01-20 Thread Carlton Gibson
>From the maintenance perspective, it's not that any one individual function is too hard to maintain — it's clearly not. Rather it's about not adding a million of them — which would add up — and in so doing essentially duplicating the entire API offered by databases. * Each one we add makes t

Re: Proposal for an "Age" PostgreSQL ORM function

2023-01-20 Thread Jörg Breitbart
Am 19.01.23 um 21:14 schrieb Jason Johns: the AGE function takes in two timestamps and returns an interval.  You can do this in python by subtracting two date/datetime objects and getting a timedelta.  what would the difference be to kick this out to the db? I'd say thats mainly about perf

Re: Proposal for an "Age" PostgreSQL ORM function

2023-01-19 Thread Jason Johns
the AGE function takes in two timestamps and returns an interval. You can do this in python by subtracting two date/datetime objects and getting a timedelta. what would the difference be to kick this out to the db? On Tuesday, January 17, 2023 at 11:11:37 AM UTC-5 niccol...@gmail.com wrote: >

Proposal for an "Age" PostgreSQL ORM function

2023-01-17 Thread Niccolò Mineo
How would you see adding the "AGE" function to the current set of PostgreSQL ORM functions? -- 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 receiving emails from it,