1.0.1 • Published 2 years ago

samconnect-mysql v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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:

  1. install module using this command

    ....

    npm install samnode-mysql

    ....

  2. import module in your code

    ...

    const model=require("samnode-mysql");

    ....

  3. 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
  1. 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.

  2. Error Handling

    	err message will be handled by this packages there is no confusion for handling error.

    Thanks for using my module.