EmployeeTracer is a command line application using node.js and the Mysql database. To start off the process I had to npm install all the packages such as inquirer, mysql and console.table along with dotenv to hide my mysql password and require all of them in const variables at the top. For the index.js to connect to mysql I needed to make a const variable with the name connection could've been any name but inside I have my password hidden in the dotenv file and database name to use. Then I made a connection to a function that displays the initial inquirer prompts asking what you would like to do each of those questions had a case with a function assigned to them. The add department function was simple the add role and employee were difficult for role I had to make a connection to the department table because the role goes into the department same thing for employee but instead I made the connection to the role table and then connected the employee table to get the manager id so the employee can be assigned a role and a manager. Ill briefly describe how I made it so I could select departments and roles when assigning roles to departments and assigning roles to employees, I made a for loop in the inquirer prompt that asked what department or role or manager and whatever your assigning it to but before that I made a let variable that contained an empty array and in the for loop I looped the response from the table then pushed it to the empty array returned the array and in the .then function I made a connection to mysql to insert the values giving by the user from the asked inquirer questions into the mysql database and console logged some type of success comment.For all the view statements I just established a connection to the database and put the response in a console.table to make it appear as a table.
employeetracer's Introduction
employeetracer's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.