This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

qmy

1.2.2-Stable • Public • Published

qmy

NPM version NPM downloads Discord server

About

Quick mysql is a powerful module that makes the mysql system easier, simpler and faster

  • Speed
  • Unlimited connection without losing connection
  • Easy to use
  • High security

Installation

npm install qmy
yarn add qmy

Announcement

(+)connect() will resolve the process by calling the then() function and it will give you a notification that the connection was successful if there is an error, it will reject the process and you can call the catch() function and it will give you the error
(-)Remove Reminders New Versions

Example usage

Connection Config

 host: "localhost",
 port: 3306,
 localAddress: undefined,
 socketPath: undefined,
 user: undefined,
 password: undefined,
 database: undefined,
 connectTimeout: 10000,
 insecureAuth: false,
 supportBigNumbers: false,
 bigNumberStrings: false,
 dateStrings: false,
 debug: undefined,
 trace: true,
 stringifyObjects: false,
 timezone: "local",
 flags: "",
 queryFormat: undefined,
 pool: undefined,
 ssl: false,
 localInfile: true,
 multipleStatements: false,
 typeCast: true,
 maxPacketSize: 0,
 charsetNumber: 33,
 clientFlags: 455631,
 protocol41: true,

#Note

Direct connection problem solving: Here

create connection

Start by creating a connection to the database. Use the username and password from your MySQL database or use uri

const qmy = require("qmy");

const connection = new qmy({
  database: "<database>",
  host: "<host>",
  password: "<password>",
  port: 3306,
  user: "<user>",
});

Documentation

Method Description explain
connect connect() will resolve the process by calling the then() function and it will give you a notification that the connection was successful if there is an error, it will reject the process and you can call the catch() function and it will give you the error Go to example
query Use SQL statements to read from (or write to) a MySQL database. This is also called "to query" the database. The connection object created in the example above, has a method for querying the database Go to example
get used to select data from a database Go to example
remove used to delete existing records in a table Go to example
set used to insert new records in a table Go to example
update used to modify the existing records in a table Go to example

connect

const qmy = require("qmy");

const connection = new qmy({
  database: "<database>",
  host: "<host>",
  password: "<password>",
  port: 3306,
  user: "<user>",
});
connection
  .connect()
  .then(() => {
    //do something
    //...
  })
  .catch((error) => {
    //do something
    //...
    console.log(error);
  });

query

const qmy = require("qmy");

const connection = new qmy({
  database: "<database>",
  host: "<host>",
  password: "<password>",
  port: 3306,
  user: "<user>",
});
connection
  .connect()
  .then(() => {
    connection
      .query("<SQL statements>")
      .then((result) => {
        console.log(result);
      })
      .catch((err) => {
        console.log(err);
      });
  })
  .catch((error) => {
    //do something
    //...
    console.log(error);
  });

get

const qmy = require("qmy");

const connection = new qmy({
  database: "<database>",
  host: "<host>",
  password: "<password>",
  port: 3306,
  user: "<user>",
});
connection
  .connect()
  .then(() => {
    connection
      .get("<table>", "<Where>:<PrimaryKey>")
      .then((result) => {
        console.log(result);
      })
      .catch((err) => {
        console.log(err);
      });
  })
  .catch((error) => {
    //do something
    //...
    console.log(error);
  });

remove

const qmy = require("qmy");

const connection = new qmy({
  database: "<database>",
  host: "<host>",
  password: "<password>",
  port: 3306,
  user: "<user>",
});
connection
  .connect()
  .then(() => {
    connection
      .remove("<table>", "<Where>:<PrimaryKey>")
      .then((result) => {
        console.log(result);
      })
      .catch((err) => {
        console.log(err);
      });
  })
  .catch((error) => {
    //do something
    //...
    console.log(error);
  });

set

const qmy = require("qmy");

const connection = new qmy({
  database: "<database>",
  host: "<host>",
  password: "<password>",
  port: 3306,
  user: "<user>",
});
connection
  .connect()
  .then(() => {
    connection
      .set(
        {
          table: "users",
          column: "id - name - color",
          values: "2324249073 - arth - red",
        },
        { sign: "-" }
      )
      .then((result) => {
        console.log(result);
      })
      .catch((err) => {
        console.log(err);
      });
  })
  .catch((error) => {
    //do something
    //...
    console.log(error);
  });

update

const qmy = require("qmy");

const connection = new qmy({
  database: "<database>",
  host: "<host>",
  password: "<password>",
  port: 3306,
  user: "<user>",
});
connection
  .connect()
  .then(() => {
    connection
      .update({
        table: "users",
        column: "name",
        PrimaryKey: "id:2324249073",//<Where>:<PrimaryKey>
        value: "arth",
      })
      .then((result) => {
        console.log(result);
      })
      .catch((err) => {
        console.log(err);
      });
  })
  .catch((error) => {
    //do something
    //...
    console.log(error);
  });

Links

License

Package Sidebar

Install

npm i qmy

Weekly Downloads

4

Version

1.2.2-Stable

License

Apache-2.0

Unpacked Size

66.1 kB

Total Files

15

Last publish

Collaborators

  • iarth
  • jamel_syr
  • naimabd