sam-mysql

This Package is simple connect to node and perform query operations easily

Usage no npm install needed!

<script type="module">
  import samMysql from 'https://cdn.skypack.dev/sam-mysql';
</script>

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:

  1. install module using this command

    ....

     npm install sam-mysql
    

    ....

  2. import module in your code

    ...

      const model=require("sam-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

  4. 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.

  5. Error Handling

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

Thanks for using my module.