Skip to content
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

Add overloadable _select_field_values method #13

Closed
wants to merge 1 commit into from
Closed

Add overloadable _select_field_values method #13

wants to merge 1 commit into from

Conversation

kraih
Copy link
Contributor

@kraih kraih commented Jan 28, 2018

This patch is very similar to #12. It adds a new method _select_field_values to be used as an extension hook, similar to _update_set_values and _insert_values.

@codecov-io
Copy link

codecov-io commented Jan 28, 2018

Codecov Report

Merging #13 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #13      +/-   ##
==========================================
+ Coverage      83%   83.06%   +0.05%     
==========================================
  Files           3        3              
  Lines         924      927       +3     
  Branches      189      189              
==========================================
+ Hits          767      770       +3     
  Misses        107      107              
  Partials       50       50
Impacted Files Coverage Δ
lib/SQL/Abstract.pm 82.28% <100%> (+0.08%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be21dde...33ac18f. Read the comment docs.

@coveralls
Copy link

coveralls commented Jan 28, 2018

Pull Request Test Coverage Report for Build 14

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.04%) to 88.565%

Files with Coverage Reduction New Missed Lines %
lib/SQL/Abstract.pm 1 89.6%
Totals Coverage Status
Change from base Build 11: 0.04%
Covered Lines: 821
Relevant Lines: 927

💛 - Coveralls

@kraih
Copy link
Contributor Author

kraih commented Jan 28, 2018

Not sure about the name, maybe _select_fields would be better?

: $fields;
my $sql = join(' ', $self->_sqlcase('select'), $f,
my ($fields_sql, @fields_bind) = $self->_select_field_values($fields);
push @bind, @fields_bind;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because $fields_sql comes before $where_sql, @fields_bind need to come before the bind values returned by ->where(). I'd suggest moving the whole fields part before the where part, to make this clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, of course.

@kraih
Copy link
Contributor Author

kraih commented Jan 28, 2018

Ok, fixed and squashed.

@ilmari
Copy link
Member

ilmari commented Jan 28, 2018

Thanks, merged with minor tweaks as daa4ccd.

@ilmari ilmari closed this Jan 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants