[ 
https://issues.apache.org/jira/browse/GROOVY-5373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18072833#comment-18072833
 ] 

ASF GitHub Bot commented on GROOVY-5373:
----------------------------------------

codecov-commenter commented on PR #2459:
URL: https://github.com/apache/groovy/pull/2459#issuecomment-4229281131

   ## 
[Codecov](https://app.codecov.io/gh/apache/groovy/pull/2459?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 Report
   :x: Patch coverage is `62.50000%` with `6 lines` in your changes missing 
coverage. Please review.
   :white_check_mark: Project coverage is 66.4944%. Comparing base 
([`f18c092`](https://app.codecov.io/gh/apache/groovy/commit/f18c0923e6a13f4da1b8e966164fa13410640814?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache))
 to head 
([`d2be528`](https://app.codecov.io/gh/apache/groovy/commit/d2be528f78f83fc66c7418b7786c645127200c3b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 3 commits behind head on master.
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2459?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Patch % | Lines |
   |---|---|---|
   | 
[...-sql/src/main/java/groovy/sql/SqlWhereVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/2459?src=pr&el=tree&filepath=subprojects%2Fgroovy-sql%2Fsrc%2Fmain%2Fjava%2Fgroovy%2Fsql%2FSqlWhereVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LXNxbC9zcmMvbWFpbi9qYXZhL2dyb292eS9zcWwvU3FsV2hlcmVWaXNpdG9yLmphdmE=)
 | 60.0000% | [3 Missing and 3 partials :warning: 
](https://app.codecov.io/gh/apache/groovy/pull/2459?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   [![Impacted file tree 
graph](https://app.codecov.io/gh/apache/groovy/pull/2459/graphs/tree.svg?width=650&height=150&src=pr&token=1r45138NfQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)](https://app.codecov.io/gh/apache/groovy/pull/2459?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   
   ```diff
   @@                Coverage Diff                 @@
   ##               master      #2459        +/-   ##
   ==================================================
   + Coverage     66.4868%   66.4944%   +0.0076%     
   - Complexity      30269      30270         +1     
   ==================================================
     Files            1411       1411                
     Lines          118016     118031        +15     
     Branches        20987      20989         +2     
   ==================================================
   + Hits            78465      78484        +19     
   + Misses          33076      33071         -5     
   - Partials         6475       6476         +1     
   ```
   
   | [Files with missing 
lines](https://app.codecov.io/gh/apache/groovy/pull/2459?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
 | Coverage Δ | |
   |---|---|---|
   | 
[...s/groovy-sql/src/main/java/groovy/sql/DataSet.java](https://app.codecov.io/gh/apache/groovy/pull/2459?src=pr&el=tree&filepath=subprojects%2Fgroovy-sql%2Fsrc%2Fmain%2Fjava%2Fgroovy%2Fsql%2FDataSet.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LXNxbC9zcmMvbWFpbi9qYXZhL2dyb292eS9zcWwvRGF0YVNldC5qYXZh)
 | `87.2928% <100.0000%> (+0.0706%)` | :arrow_up: |
   | 
[...-sql/src/main/java/groovy/sql/SqlWhereVisitor.java](https://app.codecov.io/gh/apache/groovy/pull/2459?src=pr&el=tree&filepath=subprojects%2Fgroovy-sql%2Fsrc%2Fmain%2Fjava%2Fgroovy%2Fsql%2FSqlWhereVisitor.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VicHJvamVjdHMvZ3Jvb3Z5LXNxbC9zcmMvbWFpbi9qYXZhL2dyb292eS9zcWwvU3FsV2hlcmVWaXNpdG9yLmphdmE=)
 | `80.4348% <60.0000%> (-10.1902%)` | :arrow_down: |
   
   ... and [4 files with indirect coverage 
changes](https://app.codecov.io/gh/apache/groovy/pull/2459/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
   </details>
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test 
Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, 
report on failures, and find test suite problems.
   - :package: [JS Bundle 
Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save 
yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>




> Sql DataSet fails to work with non-literals in queries (enhancement required)
> -----------------------------------------------------------------------------
>
>                 Key: GROOVY-5373
>                 URL: https://issues.apache.org/jira/browse/GROOVY-5373
>             Project: Groovy
>          Issue Type: New Feature
>          Components: SQL processing
>    Affects Versions: 2.0-beta-3, 2.1.4, 2.2.0-beta-1
>            Reporter: Dr. Russel Winder
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 6.0.0-alpha-1
>
>
> All the examples of using _findAll_ in the _Sql_ _DataSet_ class use literals 
> for the search values of queries. Using free variables causes failure as 
> Groovy does not implement lexical closure automatically.  However this can be 
> realized using the Closure delegate field. I therefore believe that the 
> following example fails because the _Sql.SqlWhereVisitor_ fails to lookup 
> variables but assumes that all query values are literals.
> {code}
> @Grab('org.xerial:sqlite-jdbc:3.7.2')
> @GrabConfig(systemClassLoader=true)
> import groovy.sql.DataSet
> import groovy.sql.Sql
> final words = []
> Sql.withInstance('jdbc:sqlite:database.db', 'org.sqlite.JDBC') {database ->
>   final wordsTable = new DataSet(database, 'words')
>   (0 ..< 4).each {i ->
>     // This doesn't work as SqlWhereVisitor doesn't resolve variables it only 
> looks for
>     // literals.  cf.  http://jira.codehaus.org/browse/GROOVY-5373
>     final query = {item -> item.id == i}
>     query.delegate = {i: i}
>     query.resolveStrategy = Closure.DELEGATE_FIRST
>     words << wordsTable.findAll(query).firstRow().word
>   }
> }
> println words.join('')
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to