News for hackers. Stuff that matters.
Re:How not to structure database-backed web apps: performanc... by vidarh on Thursday June 28, 2018 @05:56AM (#17415480)
In Ruby, using Sequel:

    DB[:cars].where { insurance_end_date < Time.now }.count
(replacing "Time.now" with Sequel.function("NOW") if you want server side, or whatever date/time formatting function you want that'll return time/date in your desired format client side; client side it'll be evaluated once)

I think most ORMs can do a reasonable job at this in languages where you have sufficient flexibility in overloading behaviour.

There are no comments on this comment yet.