content: package com.pomodoro.app.config;
  
  import javax.sql.DataSource;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  import org.springframework.context.annotation.Profile;
  import org.springframework.core.env.Environment;
  import org.springframework.jdbc.datasource.DriverManagerDataSource;
  
  @Configuration
  public class DatabaseConfig {
  
      @Autowired
      private Environment env;
  
      @Bean
      @Profile("dev")
      public DataSource sqliteDataSource() {
          DriverManagerDataSource dataSource = new DriverManagerDataSource();
          dataSource.setDriverClassName(env.getProperty("spring.datasource.driver-class-name"));
          dataSource.setUrl(env.getProperty("spring.datasource.url"));
          return dataSource;
      }
  
      @Bean
      @Profile("prod")
      public DataSource postgresqlDataSource() {
          DriverManagerDataSource dataSource = new DriverManagerDataSource();
          dataSource.setDriverClassName(env.getProperty("spring.datasource.driver-class-name"));
          dataSource.setUrl(env.getProperty("spring.datasource.url"));
          dataSource.setUsername(env.getProperty("spring.datasource.username"));
          dataSource.setPassword(env.getProperty("spring.datasource.password"));
          return dataSource;
      }
  }