Skip to content

Commit

Permalink
changes db/mysql info for .env
Browse files Browse the repository at this point in the history
  • Loading branch information
JDR8888 committed Mar 15, 2023
1 parent fb5cec2 commit cef687b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
16 changes: 4 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
const inquirer = require('inquirer');
const mysql = require('mysql2');
const cTable = require('console.table');
require('dotenv').config();

const connection = mysql.createConnection( {
host: 'localhost',
user: 'root',
database: 'company_db',
password: 'Oushy2023.'
user: process.env.DB_USER,
database: process.env.DB_NAME,
password: process.env.DB_PASSWORD
});

connection.connect((err) => {
if (err) throw err;
console.log('Connected!');
});

// const table = 'department';
// connection.query(
// `SELECT * FROM ${table}`, function(err,results,fields) {
// console.table(results)
// }
// );



const options = [
{
value: "view all departments",
Expand Down
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"license": "ISC",
"dependencies": {
"console.table": "^0.10.0",
"dotenv": "^16.0.3",
"inquirer": "^8.2.4",
"mysql2": "^3.2.0"
}
Expand Down

0 comments on commit cef687b

Please sign in to comment.