New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute to define whether a calculated property is used by default in a select statement with findAll() #122

Closed
chapmandu opened this Issue Nov 27, 2012 · 5 comments

Comments

3 participants
@chapmandu
Member

chapmandu commented Nov 27, 2012

Some calculated properties should not be used in a select statement by default if the select attribute is not specified, particularly aggregate functions and complex statements. They can significantly affect existing application code if added part-way through development.

An attribute to determine whether a column is used in a select statement (only when a select attribute has not been defined) would be useful. It would default to "true". One would need to specify these columns in the select statement to use them.

Eg:
<cfset property(name="yearcreated", sql="YEAR(createdat)", includeInSelect=false) />
<cfset property(name="thecount", sql="COUNT(1)", includeInSelect=false) />
<cfset property(name="complex", sql="[a really complex bit of SQL]", includeInSelect=false) />

Comment 1 by project member tpetru...@gmail.com, Jun 30, 2012 look at $createSQLFieldList()

Copied from
http://code.google.com/p/cfwheels/issues/detail?id=843

@ghost ghost assigned rip747 Dec 13, 2012

@perdjurner

This comment has been minimized.

Contributor

perdjurner commented Jul 14, 2014

Yes, great idea!

@chapmandu chapmandu modified the milestones: 1.2.0, 2.0.0 Jul 15, 2014

@chapmandu

This comment has been minimized.

Member

chapmandu commented Jul 15, 2014

Changed milestone from 2.0 to 1.2

@perdjurner

This comment has been minimized.

Contributor

perdjurner commented Apr 21, 2015

Running out of time for this to be in 1.4, postponing.

@perdjurner perdjurner removed this from the 1.4.0 milestone Apr 21, 2015

@perdjurner

This comment has been minimized.

Contributor

perdjurner commented Apr 25, 2015

Aggregate functions should never be in the select statement unless group by is used.
Ideally we should just not include them in those cases.

@perdjurner

This comment has been minimized.

Contributor

perdjurner commented Jun 16, 2015

Needs a test written before release.

@perdjurner perdjurner reopened this Jun 16, 2015

@perdjurner perdjurner added this to the 1.5 milestone Jun 16, 2015

@perdjurner perdjurner closed this Jun 28, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment