Node.js + MySQL CRUD - GET, POST, PUT and DELETE

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi or welcome to code affection in this video we have discussed all you need to know about implementing MySQL crud operations with no.js API things like how to connect with Mi SQL database then how to implement insert update delete and retrieve using direct queries and also with already accessing stored procedures so please watch till the very end of the video now without further Ado let's get started with creating the node.js project inside this folder for that first of all we have to open command prompt from the same folder directory so here is the shortcut just replace this folder path with the command CMD then hit enter so that the command prompt will be opened from the same folder directory here now to create the node.js project just execute this command npm init I will name this project as node.js MySQL create for rest of the configurations we will keep the default values so we just need to keep hitting enter like this finally to confirm the configurations that we have provided just type y4 yes so as a result of this command execution here we have a new file package.json now let's open this folder inside vs code before that let's create this command prompt with this command CLS now let's open this folder in service code editor now before going forward with this node.js project let's set up a my SQL DB for that here is my workbench now from this left panel you could see the tab for schemas inside that right click then create schema inside this project we are dealing with employee details so I will name this schema or DB as employee DB to create the DB click on this apply button so here is the corresponding SQL script for creating the DB click on this apply button to execute the script here that's it so here we have the new DB employee DB now I'm going to create a table inside the DB for that let me open this SQL tab here now I'll copy paste the script for creating the table don't worry I'll be providing this MySQL script in the GitHub repository so here we are going to create the table employees inside the employee DB more about the containing column will be discussed in a bit now to execute this table creation script click on this lightning simple here boom that's it you could see the newly created table inside this tables node here so here we have the table employees now let's check its design so these are the containing columns ID name employee code and salary and we have set this primary key column ID as Auto increment so that we don't want to insert values into it it will start from one and increment by 1 upon new record insertion now obviously the table is empty now to get started with this DB I'm going to insert few employees into this table for that let me open one more SQL Tab and I will be copy pasting the insert script like this click on execute boom that's it so here we have inserted four employees into the table you could check that inside this employees table by re-executing this query select query so that's it so here we have inserted four employees into the table now within this employees table we're gonna implement the credit operations from this node.js API here so these are the required npm packages to get started with the application first of all we have my sequel to which has us to query MySQL databases from our node.js application actually there is another package called MySQL here is the package this package also serves the same purpose I have used this package in one of my old node.js video but in this project we'll be using this MySQL to package which is the latest and fastest and then obviously we have this Express package so this is what makes our node.js application into RS full API and here we have the final package body parser which helps us to convert the incoming body requires into a Json format so let's install these three packages into our application MySQL to express body parser hit enter so here we have done with the installation you could check them inside this package.json under dependencies now let's start with connecting DB using this package MySQL to you could see the detailed explanation on using the package inside this npm page here actually it provides two ways to connect with the DB first of all we have create connection method and here we have the create pool method this poor method has some advantages that it helps us to reduce this time span in connecting with the MySQL server by reusing a previous connection leaving them open instead of closing when you are done with them while in case of this conventional method which is this create connection method we have to close the connection once we are done with the query execution so I'll be using the correction pull method so first of all I'm going to create a file called db.js now first of all let's import the package my SQL to now I'm going to create a pool object called MySQL port so here we go we just need to invoke this method create pool inside that we have to pass this object containing the DB credentials so first of all we have host since we are using local DB it would be localhost then username then password then database name now this package has another feature called Promise wrapping so that we can execute a query like executing a promise we're gonna discuss that in a bit for that we just need to import the package from this subdirectory here so import the package from my sequel to promise now with this MySQL pool object we can execute any query we want from the DB but before that we have to make sure whether it is possible to make a successful connection with this given credentials or not usually in other ways of connecting with the DB there will be a method something called connect which helps us to uh know whether a connection is possible with the current credentials or not but unfortunately with these NPA packages like this there is no such method so we're gonna do something very simple like this we're gonna execute a simple query a hard-coded query like this select one so if there is any error in executing this simple select query here it will be related to the given credentials here and I think it is really important to check the correctness of these given credentials before actually executing a real query now since we are using the promise wrapping we can work with the query result as a promise using this method then and catch now if there is any error we will do this DB connection field and inside the next line we will print the error object now inside this access callback let's print this uh returned object okay fine let's execute this db.js file node db.js oops DB connection failed access denied for the given user don't worry I was just messing with you guys there is no user with this given username let's be real fruit password one two three four now we have to re-execute this node command so instead of that I strongly recommend this npm package called not mod this package helps us to automatically restart the application when FY is inside the directory changes it is better to install the package globally in your machine so that you can use this package in any node.js application since I have already installed this package I am not going to do that again so make sure to install this package if you haven't already so here we go nordmondb.js boom that's it don't worry this is the success response that we have inside this then method here so this is the under response returned from executing this select query here so always when you execute a query it will retain an array like this and the result what we are looking for will be though inside this fourth item here so here we have the record returned as a result of executing this select one query so here we have the one returned within this column name one now we can say that we have made a successful connection with the MySQL server now let's rewrite this success callback DB connection succeeded now let's start the express server that will be done inside the root Javascript file index.js so let's create the file index.js first of all we'll import the package express then as always we have to create this app object to work with the Express package we'll be just calling this method Express that we have just imported here in order to combine both of these variable declarations into one statement we could do this after the express we need another constant called app and which is created by invoking the previously imported or created a method Express now let's start this uh within this port number 3000 and here we have the success callback inside that we will just print this server started at the given port number now I think it is better to start the express server once we make a successful DB connection so I'm going to do this from this db.js file I will export this MySQL pool by default for that we could do this module dot exports is equal to mySQL port now we can import this inside this index.js normally I keep both package import and local Imports separately like this so let's import the MySQL pool here I'll import it as DB from the file db.js file now instead of validating the correctness of these given credentials here I'm gonna move this into this index.j is here now we have to call this query method from this imported DB now let's expand this access callback and let's start this server inside the success callback here because there is no point in starting the express server if you are not able to connect with the DB right so first of all we have verified the correctness of the given DB credentials and then we have started the express server at the port number 3000. now let's retrieve the existing employees from this employees table that I'm gonna add a specific controller so first of all I will add this folder controllers inside that we will have this controller employee controller first of all let's import the express server and then from that we have to create another object called router that we can invoke this method router from Express now I'm gonna create a get web method here router dot get can be called for now the corresponding path will be just a forward slash it will append the uh base route into it in a bit now as a second parameter we can pass this function to handle the request with these parameters request and response for novices return this sample text list of employees at the end of this controller we will just import this router by default now let's add this router into the running instance inside this index.js first so far we have to import the router here configuring the route can be done inside the middleware so that we can make use of this method app dot use so here we have the base path API forward slash employees so all the requests starting with this pattern will be handled inside this employee controller instead of this generic name Let It Be employee routes now we just need to pass the same here so the corresponding URL for this get web method will be like this HTTP localhost we have started this server from the port number 3000 and then we have to append this base path of the controller and then here we have the forward slash that's it we can make get requests with your browser itself like this just paste the URL here then hit enter so here we have this string response list of employees so that's how routes works you can only test get requests from web browsers like this in order to test other types of requests like post put or delete you can use this software called Osman but in this project I will be using the vs code extension called thunderclient so here is the extension I have already installed this extension on this IDE you could see that here thumb decline now click on this new request here now let's make the get request to this URL click on send so that's it now within this extension we can make any type of request get pause put delete Etc now let's modify this request Handler to retrieve the actual list of employees from the table employees here do so we have to repeat the cache method for all query executions so here we go we are inside this employee's controller so to get outside this folder we can do this then DB dot JS now here we go DB dot query method can be called and here is the corresponding SQL query select star from employees now here we have the success callback let's name this parameter as data for now now we'll return the object as it is inside the response if there is any error we can catch that here and we'll print the error object as it is and we save this normal already restarted This Server here now let's make the request again boom that's it so here we have the returned array so as always it will be an array and we only need the first item inside this array and rest of the items inside the array our metadata of entities or columns involved in the query so instead of returning the entire array we'll only return the first item in it let's make the request again that's it so here we have an array of employee records now instead of using this promise method I'm going to use the async award keywords so let me remove this then success method and let's prefix this material invocation with this keyword avoid and we only allowed to use this avoid keyword inside an async function so I will just prefix this method with this keyboard async now in order to receive the data returned from this method invocation it will assign this method invocation into this variable rows now if you are not familiar with async award I strongly recommend you to have a better understanding on these Concepts like callback promise sing a white Etc I have given a tutorial Link in video description it gives a better explanation on explaining these three concepts now finally I will send this object like this Ross let's make this request again see this time we have the whole array like we had in previous case in order to retrieve the first element inside the array we can go for the JavaScript destructuring syntax for example here we have an array colors inside that we have three colors in it now we can restructure colors inside them like this color one color two and let's assign the array here colors now let's print these variables into the developer console So currently we are using cold sandbox and here we have the corresponding inner console tab let's reload this page so here we have the two items that we have restructured from these colors array now if you only want the first element inside the array we can do this color one that's it we load the page see currently we are only retrieving the first element green like this we're gonna retrieve the first element inside this whole array for that we will use this D structure in syntax now this is corresponding to the first element inside the returned array now let's make the request again boom that's it now if you want to master JavaScript this structure and syntax and brush parameter I have given a video tutorial Link in video description please go through it now back to es code now I think it is better to move all of these DB related operations into a respective service file so I'm gonna create this folder here services and inside that we will have this employee service now let me cut this DB import and pasting inside this service class now I'm going to Define this method get all employees so I will Define this method as async we don't have any parameter for this method now let's move this method invocation into this service method and finally we will be returning this Ros array so this contains all of the employees inside the employees table now along with defining this method I want to export this same so I will do this module dot exports.get employees now let's import this service class as a whole here service so let's invoke the material get all employees and here we have the my keyword and The Returned array can be accepted like this employees let's make the request again that's it so that's all about organizing the code into control and service class files now next we are going to talk about global error handling inside the project and let's return a string response like this and let's return response like this and let's return a string response like this now in order to avoid this we are going to have a global error handling so that we can catch all of the errors inside the application at a given place Express middleware inside this index.js so here we go app.use method can be called into that we just need to pass a request Handler like this it is having four parameters error request response and next so the request Handler must have these and that's how the express identifies this as a global error handle okay now inside This Global error handle I will just print the error object like this during update operation we'll talk about the return of say something when draw now along with this string response we can return a status code like this status and we can pass the seat is code 500 meaning something went wrong inside the server so this will catch all of the orders inside the application and that doesn't mean you can't handle any error inside your application anywhere if there is any unexpected or inside the application that will be cached with this middleware and if you throw any error in between the execution and that will also be reached here so if you have specified already a status code instead of 500 we have to consider that here so we could do this status sorry we have misspelled status method so while handling the internal inside the application other than this index.js if you have already given a status that will be assigned to the response otherwise we will use this status 500 as a default now if you check the express documentation so here we have the home page of the Express package and you could see the corresponding documentation inside this error handling let me open that inside a new tab here we have the same Global error Handler middleware but defining This Global error Handler is not enough to handle all of the errors inside the application let me show you what I meant by that let's try to execute a wrong SQL query for example I will change this select keyword here like this if we execute this query we will get an error for sure and as per the documentation here it must be handled inside This Global error Handler here let's check whether it works or not let's try to make the same request again oops we got an error that's for sure but it's not handled inside This Global error Handler here because we are not getting this text message inside this response it's a plain error you could conclude the same if you look into the terminal where we have started this server the app is Crash meaning that the error is not handled inside the project or you could say the error is not reached inside the global error Handler here so the reason for not working this Global error Handler is that we have used async request handlers inside this Express package in order to work this Global error Handler with assing avoid request handlers we have to install the express 5 version but at present we only have Express 4 stable versions if you go to the home page you could see that here we have a beta version of X Plus 5. so the solution would be you could install the beta version of the Express package you could see the corresponding documentation here we can replace the express 4 package with this X plus 5 beta version in future while you are watching this video if the Express package has a stable version of Express 5 you don't need to worry this Global error Handler must work since it has been a long time waiting for the X plus 5 package you should know these things I'm going to give you an additional solution which is installing this npm package express async errors so this is the package you just need to install this package so there are two solutions if you don't have a stable version of Express 5 install this Express 5 beta version instead of X plus 4 package or you can install this package instead of going for the beta version I'm going to install this extra package here once you install the package you just need to import the package inside the file where you have added routes into Express server since we are adding all of the routes inside the application into Express middleware from this index.js I'm going to import the package here so you just need to import the package where you have added the routes into the express server let's try to execute the wrong SQL query again boom we got the string response from the global error Handler here that's it so that's all about global error handling now since we have this Global error Handler implemented here we don't need Azure catch method like this for every query execution it will be handled inside the global error Handler here now let me correct the typo here next we are going to retrieve a specific record with a given ID for that first of all let's define a method inside the service class here for that I will duplicate this method and let's name this method as get employee by ID for this method we have a single parameter ID which is the employee ID now let's add the work Clause here for ID is equal to ID that we have passed into the method now back to the employee controller sorry here we have a typo inside this URL as you can see inside this request we need to double slash before localhost that's it now let's add a get web method corresponding to this newly added method here for that I will copy paste this get web method now for this get web method we expect an ID query parameter and we'll call this method get employee by ID and we have to pass the corresponding employee ID here now it's better to rename this variable as employee because we only expect a single employee record let's save this then back to the thunderclient first of all let's retrieve all of the existing employees so these are the employees that we have inside the employee table now let's try to retrieve a single employee this q1 ID for that we just need to pass the corresponding ID at the end of the request like this so that it will be handled inside this get web browser let's make the request boom that's it now there is a possibility of SQL injection in generating the SQL strings through string concatenation like this now if you are not familiar with SQL injection in brief you just need to understand this whatever we have passed as the ID here will be directly concatenated to the strings here thereby a hacker can easily pass some manipulative SQL strings at the end of the URI here like dropping the table or deleting all of your quotes from the table Etc in brief that's all you need to understand about SQL injection in order to avoid this you can use the pre-prepared statements as mentioned inside this MySQL to documentation here thereby will be marking the places where we want to replace some values like this and the value for this placeholder will be passed as a second parameter inside array in the respective order now let's modify this query accordingly we'll add the question mark here instead of this concatenation we'll pass this array as a second parameter and let's pass the ID here so this is what we meant by pre-prepared statements the first question mark will be replaced by the first element inside the array and that's how it works now both of these string and the value array will be passed separately into the SQL server and thereby we can avoid the SQL injection now since we are retrieving a single record let's rename this variable to something like raw it's a DB terminology let's change that into record and let's change this into records now let's try whether it works or not that's it now suppose we are passing an ID which is not present inside the employee's table for example five we will get this empty array we have to handle that inside the web method here for that we will do this if employee dot length is equal to 0 we have to set this status code to 404 meaning not found what you are looking for and will send this Json response nor a code with q1 ID and here we have the else part now let's try the same see now we have the response for not four no record with the given id5 so that's all about this get web method now let's try to implement the delete operation before insert an update so I will just copy paste this method here and here we have the service method delete employee we already have the ID parameter now the corresponding delete query will be like this delete from employees where ID is the given ID for now let's keep this variable as it is let's define a corresponding delete web method here that I will copy paste this below and this request is of the type delete we expect an ID parameter and here we have the method delete employee here also we have the possibility of not finding the given employee ID so I will need this if else block here in a bit for now I will just comment it like this let's return this response delete it successfully So currently we have these much employees now let me delete this employee with the ID too so here is the corresponding URL and we have to change this request method into delete so when we execute this the return object will be passed to this record and it is returned to the webmaster here now to see what is returned from the operation let's print the variable here let's make the request boo let's check whether the corresponding record is already deleted or not see there is no employee with the id2 now let's check the return object so this is what is being written after the delete operation inside that you could see the property affected rows it indicates that how many records or rows are deleted from the table so currently it is one one employee is deleted now if you try to delete an apply which is not present inside the table it should be zero let's check that make this request again because at present there is no employee with this ID too even now we are getting this string response deleted successfully that we can fix enabled now if you check this return object you see affected rows e0 because no record is being deleted so by looking into this property affected rows we can tell how many requests be affected with the delete operation so instead of returning this raws from this service method we can return like this record dot affected rows and thereby we can tell if there is an employee with the given ID or not so let's change this variable name to effector rows let's uncomment this if else block if affected rows is equal to 0 it will return this for not for response saying that not a quote with the given ID else we will send this response delete as successfully so hope you understood how it works now let's make the request again boom we got the response for not for nor a code with the given ID now there is an employee with the id4 now let's try to delete him see delete it successfully now instead of accepting the entire object return from the delete operation you can just restructure this specific property that I have already discussed in my JavaScript tutorial link is the in video description so instead of just restructuring the first element inside the array from the first array we have to restructure this property affected rows so here we are creating a new constant affected rows its value will be assigned from objects like this now let's return this variable as it is now let's verify that by deleting the already deleted record see it's working perfectly fine so here we have gone for in-depth restructuring so that's all about delete operation now let's go for insert and update operation now for insert and update operation I want to do the operation through store procedure instead of generating the query from this node.js project like this so a store procedure gives you the reusability of procedures in various applications you use this same DB so in order to create a stock procedure you can right click on this dot procedures then click on create store procedure I have already prepared a store procedure for these two operations let me paste that here I have given this script in the GitHub repository when you execute in this script make sure that you are executing that from the window open through this create stored procedure so inside this stored procedure employee add or edit we are implementing both of the operations add or edit based on the value of the past ID we can decide whether we we have an insert or update operation for insert operation ID will be zero so we'll be inserting a new employee with the given values here and for the update operation we'll update those columns for the given ID independent of the operation at the end of the procedure we are returning this raw count it indicates number of rows affected through either of these operations insert or update and we are returning that with this column name affected Roots same as that we have here inside this delete operation so this will be helpful for update operation I will be explaining that in a bit now to create the store procedure click on apply that's it so here we have the new stored procedure USP employee add or edit now let's look how to invoke that from our node.js project here that first of all let's create a service method called add or edit employee now for this method we have two parameters object and the ID now for insert operation inside this first parameter or BJ we are expecting the values of the employee which is to be added and for the update operation it will contain the modified values of the object based on the value of the ID here we'll decide whether we have an insert or update operation Now by default I will set the value 0 for this parameter so if there is no value provided for the second parameter then this ID will be having the value 0 and it will go for the insert operation to invoke this stored procedure here we can do this call the name of this chart procedure and here we have a pair of parentheses like we are invoking a method and here we have to pass the values for these parameters here one by one so here we go four question marks so here we are using the pre-prepared statement like we have done for this delete and this get web method here now we can pass the values into it like this first of all we have the ID then name employee code and salary so here we go obj dot name employee code and salary and the return object or the record will consist of a column called affected rows and that's what we are retrieving here talk about the return object during update operation now let's add the corresponding web methods inside the controller with that let me copy paste this delete method first of all we have the insert operation so let's invoke this post web method for pause we are not expecting an ID parameter now let's get rid of this if else block here and let's invoke this method add or edit now for this post request the object which is to be inserted will be passed inside the request body so we'll pass that into this method here request body now we don't have to pass the value for the second parameter we will go for the default value which is 0 that's what we want for the insert operation if this method is executed without any error we can tell that the inside operation is already successful so we don't need to retrieve anything from the return object so here we go we have the response like this status or set this status as 2.1 it indicates that a new record is being created inside the DB okay and here we have the response created successfully let's try whether it works or not first of all let me retrieve all of the existing records sorry we have to make a get request So currently we only have two employees Now to create a new employee we have to make a post request the URL will be same as you can see here now the object which is to be inserted should be passed inside the request body here for that I will copy paste this object now we don't have to pass the ID property here now for insert operation it will be automatically set by the MySQL server it goes in sequential order so here we have the new employee you could see this array here a bad string we have to enclose this uh property name within codes and let's put a comma at the end some of the errors will be fixed if you click on this format here let's change the employee code to something 87 and let's change the salary click on send sorry something went wrong here we are executing the global error Handler let's check the running terminal here cannot read properties of undefined reading name oh sorry before go to configure the middleware with Podi pass so let's add that here body parser now let's configure the incoming request body like this so we just need to invoke this method Json from Jodi pass sorry body pass this will convert the incoming request body into Json format let's save this hopefully the norm one will restart the server okay now let's make the request again boom that's it created successfully let's make the get request again so here we have the new employee Olivia gasoline and rest of the uh values are assigned as we have given here and the ID is in incremental order in between these requests we had an employee with id4 we already deleted him by the way after watching this video I would recommend you to go through the video description or I have given the related videos and recommended premium courses so that you can Master the programming languages or Frameworks for building projects like this now back to our topic now let's implement the update operation with this same service method add or edit for that I will just copy paste this post method instead of post we have port and for this update operation we need the corresponding employee ID the request body will contain the updated values of the employee and as a second parameter we have to pass the corresponding employee ID so here we go request Dot params.id now let's talk about the return object from this service method add or edit inside the stored procedure we have returned the raw count as effector rows so it should be the inside the returned object but we don't know how it is returned so instead of directly going for the restructuring here let's name the first item inside the array as data and we'll return that from here now back to the put web method I will receive that inside this object data and we'll return that inside the response like this now let's try to update an existing employee let's update this employee with the id5 so here is the corresponding URL and the type of the request will be put and inside the body tab we already have the object that we use for creating the same employee now I just want to update the name of the employee so here we go Olivia Jones let's make the request so here we have the return object we can talk about that in a bit let's check whether it is updated inside the DB or not currently we have Olivia Kathleen now let's check whether it is updated to the new value or not so that's it so the update operation is working perfectly fine now let's talk about the return object here so the first item inside the whole result is an array like this and here we have the affected rows that is returned from the store procedure here along with this inner array we have this object by default returned from the MySQL server and here also we have the property affected rows like we had in our delete operation but for the store procedure execution it is not returning the uh proper value currently as you can see here even though we have updated a record it is returning affected rows as zero so we are going to depend on this affected rows that's our select query here okay now in order to retrieve this property affected rows from this whole array first of all we have the first array which is the first item inside this outer array so here we go data then at zeroth index we have the inner array and inside this inner array this object is the first item it's like a 2d so here we have the second index zero now this is corresponding to the object here now from that we have to read this property affected rows now instead of doing this we can go for the in-depth restructuring like this here first of all we have to restructure this array so here we have the array wrapping so that we can retrieve or destructure the first element inside the array and from that array we have to restructure this first element so here we have the extra pair of square brackets so this is corresponding to the inner object from that we have to destructure this property affected Ros so in effect we are creating this constant affected rows and we are de-structuring its value from the whole array with this in-depth restructuring now we Java method you find easy to understand to retrieve this affected rows property from the whole array you can go for it for now I will go for this in-depth this structuring now let's return this constant from this service method now we got what we want now back to the put web method here I will rename this property as affected rows now based on the value of this property we could tell whether we had an employee with the given ID or not for now I will just copy this if else block here if affected Ros is equal to 0 I will return F4 not for response saying that not a chord with the given ID otherwise we'll return this text message updated successfully okay now let's try this now let's give a hike for this employee salary here send the request so here we have the message saying that updated successfully now it should be updated inside the DB also see so in this case the number of rows affected with the update operation is 1 and thereby we have this proper success message returned from the put method now if we try to update an employee which is not present inside this table then it should return this for not for response so here we go let's try to update an employee with the id6 currently there is no employee with the id6 let's make the request see here we have the 404 response for the id6 because the number of a vector rows for this update operation will be zero so without going for an extra query to check whether we have an employee with the given ID before the update operation I found this is much better with a single stored procedure after the update operation number of rows affected with the operation will be written and from that we could tell whether we had an employee with the given ID or not hope you understood what I'm doing here now finally I want to make few more modification inside this get web method for a given ID currently we have the get web method this get web method will return all of the employees from the table now to retrieve this employee with the id2 we have to make the request like this just pass the ID at the end of the URL that's it now actually from an API for a get request with a given ID we always expect a single object like this instead of wrapping it in an array so first of all I'm gonna change this service method get employee by ID and here we have this structure the first element from the array let's retrieve the first element from this array so here we have the in-depth restructuring now of course we want to change the corresponding get method inside this controller before that let's make this request again now let's change the corresponding web method the written value from the service method will be assigned to this property employee now we have to change the if Clause here now if we try to make a get request for a non-existing employee then the returned array will not have any item so the restructuring will give the value undefined for this constant record so instead of checking the length here we could do this if employee is equal to undefined we will return this for not for response okay otherwise we'll return the xat employee object let me save this back to the Thunder client let's try to retrieve an employee with the ID 11 boom that's it so that's it guys in this node.js tutorial we have implemented MySQL cred operations insert update delete and retrieve the subscribing to this channel if you haven't yet also please like and share this video with your friends and colleagues so that they can also benefit from this have a nice day bye
Info
Channel: CodAffection
Views: 29,297
Rating: undefined out of 5
Keywords: CodAffection, MySQL CRUD with Node.js api, Node.js get post put delete with MySQL database, MySQL database insert update delete in Node.js, retrieve a record by its id, how to avoid sql injection in MySQL DB with nodejs, mysql2 package, Node.js MySQL driver, implement CRUD operations in Node.js using MySQL server, Node.js MySQL express, how to executed MySQL stored procedures in Node.js, using MySQL in Node.js, how to connect MySQL server from Node.js, global error handling
Id: YkBOkV0s5eQ
Channel Id: undefined
Length: 44min 38sec (2678 seconds)
Published: Mon Apr 10 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.