Hi again,
seems I am in the flow for sending out Glorp fixes.
During my experiments to find out under which circumstances
certain alsoFetch:ed objects aren't registered, I tried to extend
my test case I just posted here today. I wanted to add a query
that ends up as
SELECT ... FROM .. WHERE ... AND DATE(TIMESTAMP) > someOtherDate
So I tried something like
Query read: LogEntry where: [:entry | entry timestamp time >=
currentTimeMinus30Seconds].
... and guess what: Glorp has no definitition for the SQL functions DATE() and TIME() and throws an error because it has no mapping for #time...
The fix is easy. Afaik, all SQL databases support DATE() and TIME(), so we can add these function to the set of basic functions in FunctionExpression class>>#createBasicFunctionsFor:
Just add these lines to FunctionExpression class>>#createBasicFunctionsFor:
defaultFunctions at: #date put: ((PrefixFunction named: 'DATE') type: aDatabasePlatform date); at: #time put: ((PrefixFunction named: 'TIME') type: aDatabasePlatform time).
^defaultFunctions
That's it.
Joachim
--
You received this message because you are subscribed to the Google Groups "glorp-group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glorp-group...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glorp-group/ee8df3fd-7d8c-41f5-a6b3-0d316cbb29d3%40objektfabrik.de.