Skip to content

Commit

Permalink
testing elevation endpoint on dev
Browse files Browse the repository at this point in the history
  • Loading branch information
amyfromandi committed Sep 9, 2024
1 parent 0fb9740 commit aea3843
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
7 changes: 0 additions & 7 deletions v2/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ exports.pg = {
database: process.env.database
};

exports.elevationDatabase = {
host: process.env.host,
port: process.env.port,
user: process.env.user,
password: process.env.password,
database: process.env.database
};



Expand Down
9 changes: 4 additions & 5 deletions v2/larkin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,14 @@ const { Client, Pool } = require("pg");
"In Macrostrat v2, 'geomacro' is merged with 'burwell' into the 'macrostrat' database.",
);
}
let connectionDetails = credentials.pg;

if (dbName == "elevation") {
/* Special case for elevation database (temporary) */
let { connectionString, ...otherConnectionDetails } = credentials.elevationDatabase;
} else {
let { connectionString, ...otherConnectionDetails } = credentials.pg;
connectionDetails.database = 'elevation'
}

const pool = new Pool({ connectionString, ...otherConnectionDetails });
console.log(connectionDetails)
const pool = new Pool(connectionDetails);

pool.connect(function (err, client, done) {
if (err) {
Expand Down

0 comments on commit aea3843

Please sign in to comment.