You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Depending on dresende/node-sql-query#10 I want to group by a DATETIME field and want to pass the format string to be able to group by a day, year or even an hour.
Great, in my testcase that works fine. I still need to deploy that into my
productive environment, but I don't expect any complications. I'll close
this issue if it works.
Am 06.07.2013 01:03 schrieb "Diogo Resende" notifications@github.com:
You can now call any supported function like this:
Activity
dresende commentedon Jun 20, 2013
Can you show me an sql example?
sql-query@0.0.28 (#204)
dresende commentedon Jun 20, 2013
ORM still does not support it, I have to think how to do it. If you have any idea of how this could be done please post an example.
Locke commentedon Jun 20, 2013
If I see it correct ORM does not use the
.fun(..)method from node-sql-query, does it?I'm thinking about either a general support for the fun method or a special implementation with strftime.
dresende commentedon Jun 20, 2013
Yes, it doesn't use it but maybe it should, or... the drivers should. Or at least expose it.
Locke commentedon Jun 21, 2013
In Locke/node-orm2 and Locke/node-sql-query I simply added strftime to the aggregation functions and can now group via:
I don't know if it's compatible with all drivers, therefore I updated only the sqlite driver.
As this is a lot of typing I could imagine adding wrappers like
.groupByDay('myDateField')in the AggregateFunctions proto.dresende commentedon Jun 21, 2013
I just don't want to add strftime directly, I want to expose the generic function call. And have also to expose the
querypart.dresende commentedon Jun 21, 2013
I would expose strftime if it was generic or have the same function across drivers (even if it had different names).
Fixes duplicated debug in mysql for aggregate functions, creates .cal…
dresende commentedon Jul 5, 2013
You can now call any supported function like this:
The
.as()is optional and it's just an alias that can for example be used in.groupBy.Please try the latest commit and see if it works for you.
Locke commentedon Jul 6, 2013
Great, in my testcase that works fine. I still need to deploy that into my
productive environment, but I don't expect any complications. I'll close
this issue if it works.
Am 06.07.2013 01:03 schrieb "Diogo Resende" notifications@github.com: