class GovernanceShardingSphereDataSourceFactory {

    public static DataSource createDataSource(final Map<String, DataSource> dataSourceMap, final Collection<RuleConfiguration> ruleConfigurations,
                                              final Properties props, final GovernanceConfiguration governanceConfig) throws SQLException {
        if (null == ruleConfigurations || ruleConfigurations.isEmpty()) {
            return createDataSource(governanceConfig);
        }
        return new GovernanceShardingSphereDataSource(dataSourceMap, ruleConfigurations, props, governanceConfig);
    }

}