// Path: src/main/java/com/github/mjdbc/Db.java
// public interface Db {
// 
//     /**
//      * Registers result set mapper. See DbMapper class for details.
//      *
//      * @param mapperClass the result classes. Result set row will be mapped to the instance of this class.
//      * @param mapper      mapper. This mapper will be used to map result set row to mapperClass instance.
//      * @param <T>         result type.
//      */
//     <T> void registerMapper(@NotNull Class<T> mapperClass, @NotNull DbMapper<T> mapper);
// 
//     /**
//      * Registers prepared statement parameter binder.
//      * A binder for parameter is looked up by matching class first, any superclass second or any interface third.
//      * The old binder for this type is removed.
//      *
//      * @param binderClass parameter class to be processed by this binder.
//      * @param binder      binder implementation.
//      */
//     <T> void registerBinder(@NotNull Class<? extends T> binderClass, @NotNull DbBinder<T> binder);
// 
//     /**
//      * Attaches Dbi (DB interfaces) implementation to the database.
//      * All methods will be wrapped to transaction. Transaction will be started when the first SQL statement
//      * is used inside of the method and closed on exit from the method. Transaction is committed
//      * on normal exit and rolled back if Exception is thrown.
//      * <p>
//      * If Dbi method is called from another Dbi method no new transaction will be started: the upper-stack transaction will be used.
//      *
//      * @param impl         database interface implementation.
//      * @param dbiInterface database interface to wrap with transactions support.
//      * @param <T>          type of the Dbi interface.
//      * @return wrapped instance of the @dbiInterface
//      */
//     @NotNull
//     <T> T attachDbi(@NotNull T impl, @NotNull Class<T> dbiInterface);
// 
//     /**
//      * Attaches sql interface to the database. All sql queries are parsed and validated during this call.
//      *
//      * @param sqlInterface sql interface to attach.
//      * @param <T>          type of the interface.
//      * @return interface implementation.
//      */
//     @NotNull
//     <T> T attachSql(@NotNull Class<T> sqlInterface);
// 
//     /**
//      * Executes database query that produces Nullable result.
//      *
//      * @param op  query types.
//      * @param <T> result type.
//      * @return query result.
//      */
//     @Nullable
//     <T> T execute(@NotNull DbOp<T> op);
// 
//     /**
//      * Executes database query that produces NotNull result.
//      *
//      * @param op  query types.
//      * @param <T> result type.
//      * @return query result.
//      */
//     @NotNull
//     <T> T executeNN(@NotNull DbOpNN<T> op);
// 
//     /**
//      * Executes database operation that  produces no result.
//      *
//      * @param op operation types.
//      */
//     void executeV(@NotNull DbOpV op);
// 
// 
//     /**
//      * Returns per-method timers.
//      * Statistics is collected for all methods of attached Dbi interfaces
//      * and for all @Sql methods of attached query interfaces.
//      *
//      * @return per-method statistics. Note: This is direct access to the timers map. Timers are updated concurrently.
//      * If a timer is removed from the map: it will be restarted.
//      */
//     @NotNull
//     Map<Method, DbTimer> getTimers();
// 
// 
//     /**
//      * Returns active connection assigned to current thread or throws IllegalStateException if not within DBOp.
//      */
//     @NotNull
//     DbConnection getActiveConnection();
// }
// 
// Path: src/main/java/com/github/mjdbc/DbFactory.java
// public class DbFactory {
// 
//     /**
//      * Creates new mjdbc Db wrapper for the given datasource.
//      */
//     @NotNull
//     public static Db wrap(@NotNull DataSource dataSource) {
//         return new DbImpl(dataSource);
//     }
// 
// }
// 
// Path: src/test/java/com/github/mjdbc/test/util/ProfiledDataSource.java
// public class ProfiledDataSource implements javax.sql.DataSource {
//     @NotNull
//     private final DataSource ds;
// 
//     public int nGetConnectionCalls;
// 
//     public ProfiledDataSource(@NotNull DataSource ds) {
//         this.ds = ds;
//     }
// 
//     @Override
//     public PrintWriter getLogWriter() throws SQLException {
//         return ds.getLogWriter();
//     }
// 
//     @Override
//     public void setLogWriter(PrintWriter out) throws SQLException {
//         ds.setLogWriter(out);
//     }
// 
//     @Override
//     public void setLoginTimeout(int seconds) throws SQLException {
//         ds.setLoginTimeout(seconds);
//     }
// 
//     @Override
//     public int getLoginTimeout() throws SQLException {
//         return ds.getLoginTimeout();
//     }
// 
//     @Override
//     public Logger getParentLogger() throws SQLFeatureNotSupportedException {
//         return ds.getParentLogger();
//     }
// 
//     @Override
//     public <T> T unwrap(Class<T> c) throws SQLException {
//         return ds.unwrap(c);
//     }
// 
//     @Override
//     public boolean isWrapperFor(Class<?> c) throws SQLException {
//         return ds.isWrapperFor(c);
//     }
// 
//     @Override
//     public Connection getConnection() throws SQLException {
//         nGetConnectionCalls++;
//         return new ProfiledConnection(ds.getConnection());
//     }
// 
//     @Override
//     public Connection getConnection(String username, String password) throws SQLException {
//         nGetConnectionCalls++;
//         return new ProfiledConnection(ds.getConnection(username, password));
//     }
// }


import com.github.mjdbc.Db;
import com.github.mjdbc.DbFactory;
import com.github.mjdbc.test.util.DbUtils;
import com.github.mjdbc.test.util.ProfiledDataSource;
import com.zaxxer.hikari.HikariDataSource;
import org.jetbrains.annotations.NotNull;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
package com.github.mjdbc.test;


public abstract class BaseSqlTest<S> extends Assert {
    /**
     * Low level connection pool.
     */
    protected HikariDataSource ds;
// Path: src/main/java/com/github/mjdbc/Db.java
// public interface Db {
// 
//     /**
//      * Registers result set mapper. See DbMapper class for details.
//      *
//      * @param mapperClass the result classes. Result set row will be mapped to the instance of this class.
//      * @param mapper      mapper. This mapper will be used to map result set row to mapperClass instance.
//      * @param <T>         result type.
//      */
//     <T> void registerMapper(@NotNull Class<T> mapperClass, @NotNull DbMapper<T> mapper);
// 
//     /**
//      * Registers prepared statement parameter binder.
//      * A binder for parameter is looked up by matching class first, any superclass second or any interface third.
//      * The old binder for this type is removed.
//      *
//      * @param binderClass parameter class to be processed by this binder.
//      * @param binder      binder implementation.
//      */
//     <T> void registerBinder(@NotNull Class<? extends T> binderClass, @NotNull DbBinder<T> binder);
// 
//     /**
//      * Attaches Dbi (DB interfaces) implementation to the database.
//      * All methods will be wrapped to transaction. Transaction will be started when the first SQL statement
//      * is used inside of the method and closed on exit from the method. Transaction is committed
//      * on normal exit and rolled back if Exception is thrown.
//      * <p>
//      * If Dbi method is called from another Dbi method no new transaction will be started: the upper-stack transaction will be used.
//      *
//      * @param impl         database interface implementation.
//      * @param dbiInterface database interface to wrap with transactions support.
//      * @param <T>          type of the Dbi interface.
//      * @return wrapped instance of the @dbiInterface
//      */
//     @NotNull
//     <T> T attachDbi(@NotNull T impl, @NotNull Class<T> dbiInterface);
// 
//     /**
//      * Attaches sql interface to the database. All sql queries are parsed and validated during this call.
//      *
//      * @param sqlInterface sql interface to attach.
//      * @param <T>          type of the interface.
//      * @return interface implementation.
//      */
//     @NotNull
//     <T> T attachSql(@NotNull Class<T> sqlInterface);
// 
//     /**
//      * Executes database query that produces Nullable result.
//      *
//      * @param op  query types.
//      * @param <T> result type.
//      * @return query result.
//      */
//     @Nullable
//     <T> T execute(@NotNull DbOp<T> op);
// 
//     /**
//      * Executes database query that produces NotNull result.
//      *
//      * @param op  query types.
//      * @param <T> result type.
//      * @return query result.
//      */
//     @NotNull
//     <T> T executeNN(@NotNull DbOpNN<T> op);
// 
//     /**
//      * Executes database operation that  produces no result.
//      *
//      * @param op operation types.
//      */
//     void executeV(@NotNull DbOpV op);
// 
// 
//     /**
//      * Returns per-method timers.
//      * Statistics is collected for all methods of attached Dbi interfaces
//      * and for all @Sql methods of attached query interfaces.
//      *
//      * @return per-method statistics. Note: This is direct access to the timers map. Timers are updated concurrently.
//      * If a timer is removed from the map: it will be restarted.
//      */
//     @NotNull
//     Map<Method, DbTimer> getTimers();
// 
// 
//     /**
//      * Returns active connection assigned to current thread or throws IllegalStateException if not within DBOp.
//      */
//     @NotNull
//     DbConnection getActiveConnection();
// }
// 
// Path: src/main/java/com/github/mjdbc/DbFactory.java
// public class DbFactory {
// 
//     /**
//      * Creates new mjdbc Db wrapper for the given datasource.
//      */
//     @NotNull
//     public static Db wrap(@NotNull DataSource dataSource) {
//         return new DbImpl(dataSource);
//     }
// 
// }
// 
// Path: src/test/java/com/github/mjdbc/test/util/ProfiledDataSource.java
// public class ProfiledDataSource implements javax.sql.DataSource {
//     @NotNull
//     private final DataSource ds;
// 
//     public int nGetConnectionCalls;
// 
//     public ProfiledDataSource(@NotNull DataSource ds) {
//         this.ds = ds;
//     }
// 
//     @Override
//     public PrintWriter getLogWriter() throws SQLException {
//         return ds.getLogWriter();
//     }
// 
//     @Override
//     public void setLogWriter(PrintWriter out) throws SQLException {
//         ds.setLogWriter(out);
//     }
// 
//     @Override
//     public void setLoginTimeout(int seconds) throws SQLException {
//         ds.setLoginTimeout(seconds);
//     }
// 
//     @Override
//     public int getLoginTimeout() throws SQLException {
//         return ds.getLoginTimeout();
//     }
// 
//     @Override
//     public Logger getParentLogger() throws SQLFeatureNotSupportedException {
//         return ds.getParentLogger();
//     }
// 
//     @Override
//     public <T> T unwrap(Class<T> c) throws SQLException {
//         return ds.unwrap(c);
//     }
// 
//     @Override
//     public boolean isWrapperFor(Class<?> c) throws SQLException {
//         return ds.isWrapperFor(c);
//     }
// 
//     @Override
//     public Connection getConnection() throws SQLException {
//         nGetConnectionCalls++;
//         return new ProfiledConnection(ds.getConnection());
//     }
// 
//     @Override
//     public Connection getConnection(String username, String password) throws SQLException {
//         nGetConnectionCalls++;
//         return new ProfiledConnection(ds.getConnection(username, password));
//     }
// }


// Path: src/test/java/com/github/mjdbc/test/BaseSqlTest.java
import com.github.mjdbc.Db;
import com.github.mjdbc.DbFactory;
import com.github.mjdbc.test.util.DbUtils;
import com.github.mjdbc.test.util.ProfiledDataSource;
import com.zaxxer.hikari.HikariDataSource;
import org.jetbrains.annotations.NotNull;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;

package com.github.mjdbc.test;


public abstract class BaseSqlTest<S> extends Assert {
    /**
     * Low level connection pool.
     */
    protected HikariDataSource ds;
    protected ProfiledDataSource profiledDs;