Mailing List webobjects-dev@wocommunity.org Message #319
From: Markus Ruggiero (rucotec) <webobjects-dev@wocommunity.org>
Subject: Re: [WO-DEV] How would you create such an EOQualifier representing Postgresql date_trunc(...)?
Date: Thu, 4 Nov 2021 11:09:15 +0100
To: WebObjects & WOnder Development <webobjects-dev@wocommunity.org>
Signed Data (Text SHA256)

On 3 Nov 2021, at 23:15, Ramsey Gurley <webobjects-dev@wocommunity.org> wrote:

Hi Markus,

You could create a derived attribute in your model for the truncated value, but it would calculate that every time you fetch rows as well.

Ramsey


That’s an interesting idea. Thanks for bringing this up.

However I’d define the derived attribute in the database and model it as a regular read-only attribute. I think for the db to calculate the derived value is not much overhead, so should be fine in probably any case of select.

---markus---

Btw: Ramsey, great you’re back

On Nov 3, 2021, at 9:48 PM, Markus Ruggiero (rucotec) <webobjects-dev@wocommunity.org> wrote:

No one?
I can live with raw rows but would have been great if anyone knows

---markus---

On 1 Nov 2021, at 12:54, Markus Ruggiero (rucotec) <webobjects-dev@wocommunity.org> wrote:

Need to find objects satisfying the following condition:

CHECK_IN_TIME must be at least on the same day or later than REQUESTED. Both values are stored as NSTimestamp with a 15 minutes precision.

In Postgres I would write

...where date_trunc('day', CHECK_IN_TIME) >= date_trunc('day', REQUESTED)

How can I create a qualifier for this? Is this possible at all or do I have to resort to raw rows for SQL?

Thanks
---markus---



Markus Ruggiero

rucotec GmbH                        web https://rucotec.ch
Steinenvorstadt 79                email markus.ruggiero@rucotec.ch
4051 Basel / Switzerland         mobile +41 79 508 4701












Confidentiality Notice: This email, including all attachments and replies thereto, are covered by the Electronic Communications Privacy Act, 18 U.S.C. Sections 2510-2521 and are legally privileged. This information is confidential, and intended only for the use of the individuals or entities named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this transmitted information is strictly prohibited. Please notify us if you have received this transmission in error. Thank you.


Content Unaltered as verified By:
<markus.ruggiero@rucotec.ch>
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster