jhc-systems / sqlest

Write SQL in Scala
https://jhc-systems.github.io/sqlest/latest/api/
Apache License 2.0
30 stars 17 forks source link

Update Table sql should use the table alias #94

Closed RobertEMackay closed 5 years ago

RobertEMackay commented 5 years ago

Update statement builder wasn't using the table alias in the "UPDATE

" syntax, but the where clauses were, leading to SQL that looked like

UPDATE table 
SET field1 = <new_value>
WHERE table_alias.field2 = <compare_value> 

This failed, obviously. It will now produce

UPDATE table AS table_alias
SET field1 = <new_value>
WHERE table_alias.field2 = <compare_value> 
codecov-io commented 5 years ago

Codecov Report

Merging #94 into master will increase coverage by 0.02%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
+ Coverage   82.81%   82.84%   +0.02%     
==========================================
  Files          46       46              
  Lines        1193     1195       +2     
  Branches       97       97              
==========================================
+ Hits          988      990       +2     
  Misses        205      205
Impacted Files Coverage Δ
...scala/sqlest/sql/base/UpdateStatementBuilder.scala 100% <100%> (ø) :arrow_up:

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 f8c6798...f4f6e4b. Read the comment docs.