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

executeBatch should prepare statements the same as executeCommand #84

Open AndyCa opened 6 years ago

AndyCa commented 6 years ago

replace generateRawSql with prepare statement

tests pass

haven't been able to run this locally due to difficulties with local maven

codecov-io commented 6 years ago

Codecov Report

Merging #84 into master will not change coverage. The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #84   +/-   ##
=======================================
  Coverage   81.87%   81.87%           
=======================================
  Files          43       43           
  Lines        1142     1142           
  Branches      103       98    -5     
=======================================
  Hits          935      935           
  Misses        207      207
Impacted Files Coverage Δ
...lest/src/main/scala/sqlest/executor/Database.scala 66.17% <0%> (ø) :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 7587870...57d8bfc. Read the comment docs.

DavidGregory084 commented 6 years ago

Thanks @AndyCa, but I think the tests pass because executeBatch does not have any test coverage.

Looking into this I don't think that what we are trying to do is going to work, at least not in this way - see this SO question for more details: https://stackoverflow.com/questions/34041410/batch-preparedstatement-with-different-sql-queries

I suspect if we want to fix the issue you observed with using dates with executeBatch we will probably need to fix the way that generateRawSql formats dates