README
This package allow us to connect mysql in simple way and easy to code for your projects
connect database => DbConnect(username,password,database);
Query Operations => Query(mysql query,callback function);
Follwing steps are to be follwed:
install module using this command
....
npm install sam-mysql
....
import module in your code
...
const model=require("sam-mysql");
....
connect database using following code or method
....
model.DbConnect(username,password,databasename);
....
username and password parameters are mandatory for connecting database;
username like "mysql username"
password like "mysql password"
database name parameter is optional
perform querys in mysql using follwed code:
....
model.Query(mysqlquery,(data)=>{
console.log(data); });
....
Above method contain two parameters, first one is mysql query for performing sql opreations and second parameter is callback funtion for storing response of the query.
Error Handling
err message will be handled by this packages there is no confusion for handling error.
Thanks for using my module.