Skip to content

Improved supported data-types in min() and max()#1200

Merged
mickhansen merged 8 commits intosequelize:masterfrom
xdarklight:master
Jan 5, 2014
Merged

Improved supported data-types in min() and max()#1200
mickhansen merged 8 commits intosequelize:masterfrom
xdarklight:master

Conversation

@xdarklight
Copy link
Copy Markdown
Contributor

When I started only numeric types (int and float) were supported.
After my patches 'Date' and 'String' work as well (I added a JUnit test to prove this).

Please carefully review this as I'm not sure if my new "aggregate" function in 1504b6f is good the way it is (and I'm not sure if this should be public API/has to be documented?).

PS: I only tested sqlite so far.

…ared.

Also made rawSelect's data-types options more extensible and implemented
the "DATE" case.
This gives us the possibility to use "instanceof DECIMAL" when needed.
This should fix min() and max() for postgres.
This fixed query generation (before the column type was always DECIMAL,
even if DECIMAL(10,3) was specified).
DECIMAL() and DECIMAL(10,3) are not the same - but the type matches.
@mickhansen
Copy link
Copy Markdown
Contributor

Looks good - I'm going to merge this.
We might want to look at using .find() with .fn() and .col() later on

mickhansen added a commit that referenced this pull request Jan 5, 2014
Improved supported data-types in min() and max()
@mickhansen mickhansen merged commit 29ced24 into sequelize:master Jan 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants