How can I establish a connection with the SQL database in Lambda function using Node.js? I want to get and post data in SQL database.
Thanks
How can I establish a connection with the SQL database in Lambda function using Node.js? I want to get and post data in SQL database.
Thanks
Running nodejs code in lambda is same as running same code on any other server or your local machine. You get the same nodejs runtime. There might be limitations when it comes to lambda such as package size, but there is no difference in how the code is executed.
The link below shows, how to connect to mysql from nodejs https://www.w3schools.com/nodejs/nodejs_mysql_select.asp
if you are specifically expecting mysql in lambda, this article may be a good start. https://blog.risingstack.com/getting-started-with-aws-lambda-and-node-js/
or else if you want to use mssql with lambda, look at this SO question. AWS Lambda and SQL Server Integration