text: var dotenv = require("dotenv");
  dotenv.config();
  // Update with your config settings.
  
  module.exports = {
    development: {
      client: "pg",
      useNullAsDefault: true,
      connection: {
        host: "localhost",
        user: process.env.PG_USER,
        password: process.env.PG_PASSWORD,
        database: process.env.PG_DATABASE,
        port: process.env.PG_PORT,
      },
      migrations: {
        directory: "./data/migrations",
      },
      seeds: {
        directory: "./data/seeds",
      },
    },
  
    production: {
      client: "pg",
      connection: process.env.DATABASE_URL,
      pool: {
        min: 2,
        max: 10,
      },
      migrations: {
        directory: "./data/migrations",
      },
      seeds: {
        directory: "./data/seeds",
      },
    },
  
    // db connection for testing
    testing: {
      client: "sqlite3",
      connection: {
        filename: "./data/test.db3",
      },
      // needed when using foreign keys
      pool: {
        afterCreate: (conn, done) => {
          // runs after a connection is made to the sqlite engine
          conn.run("PRAGMA foreign_keys = ON", done); // turn on FK enforcement
        },
      },
      useNullAsDefault: true,
      migrations: {
        directory: "./data/migrations",
      },
      seeds: {
        directory: "./data/seeds",
      },
    },
  };
  