package quant.rich.emoney.config;

import javax.sql.DataSource;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DataSourceConfig {

    @Bean(name = "postgreDataSource")
    @ConfigurationProperties(prefix = "spring.datasource.postgre")
    public DataSource postgreDataSource() {
        return DataSourceBuilder.create().build();
    }

    @Bean(name = "sqliteDataSource")
    @ConfigurationProperties(prefix = "spring.datasource.sqlite")
    public DataSource sqliteDataSource() {
        DataSource dataSource = DataSourceBuilder.create().build();
        return dataSource;
    }
}
