Unable to import groovy.sql.Sql in reports

I am using the jmix 2.7.4 and the reports add-on. In Cuba I could use:

import groovy.sql.Sql

to get the groovy Sql instance to perform native SQL. But when I tried this in Jmix, it failed.

Script1.groovy: 1: unable to resolve class groovy.sql.Sql

How can I import the Sql instance.

CK

I can fix the import problem by adding this dependency to the cradle:

implementation 'org.apache.groovy:groovy-sql:5.0.4'

Is this correct ?

But now I am missing the “persistence” object in the Groovy dataset which was available in the Cuba reports. What is the fix for this ?

CK