package instep.springboot;

import instep.Instep;
import instep.dao.sql.ConnectionProvider;
import instep.dao.sql.InstepSQL;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * auto configuration for instep.dao.sql module.
 */
@Configuration
@ConditionalOnBean({ConnectionProvider.class})
public class SQLAutoConfiguration {
    @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
    @Bean
    public InstepSQL instepSQL(ConnectionProvider connectionProvider, Instep instep) {
        instep.bind(ConnectionProvider.class, connectionProvider, "");

        return InstepSQL.INSTANCE;
    }
}

@@ -107,25 +107,98 @@
 dao.sql.
-InstepSQL
+Dialect;%0Aimport instep.dao.sql.InstepSQL;%0Aimport instep.dao.sql.TransactionContext
 ;%0Aimport
@@ -256,24 +256,31 @@
 onditionalOn
+Missing
 Bean;%0Aimport
@@ -387,16 +387,46 @@
 ation;%0A%0A
+import javax.sql.DataSource;%0A%0A
 /**%0A * a
@@ -493,55 +493,8 @@
 ion%0A
-@ConditionalOnBean(%7BConnectionProvider.class%7D)%0A
 publ
@@ -606,16 +606,46 @@
   @Bean%0A
+    @ConditionalOnMissingBean%0A
     publ
@@ -671,45 +671,46 @@
 SQL(
-ConnectionProvider connectionProvider
+DataSource dataSource, Dialect dialect
 , In
@@ -774,26 +774,70 @@
 ss, 
-connectionProvider
+new TransactionContext.ConnectionProvider(dataSource, dialect)
 , %22%22

improve dao AutoConfig.