An open API service indexing awesome lists of open source software.

https://github.com/blinet/qmy

Quick mysql is a powerful module that makes the mysql system easier, simpler and faster
https://github.com/blinet/qmy

database db javascript mysql mysql2 nodejs quick sql

Last synced: 10 months ago
JSON representation

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

Awesome Lists containing this project

README

          



qmy




NPM version
NPM downloads
Discord server


## About

Quick [mysql](https://www.mysql.com/) 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

```sh-session
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**

```js
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](#connect)

> **create connection**

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

```js
const qmy = require("qmy");

const connection = new qmy({
database: "",
host: "",
password: "",
port: 3306,
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

```js
const qmy = require("qmy");

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

## query

```js
const qmy = require("qmy");

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

## get

```js
const qmy = require("qmy");

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

## remove

```js
const qmy = require("qmy");

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

## set

```js
const qmy = require("qmy");

const connection = new qmy({
database: "",
host: "",
password: "",
port: 3306,
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

```js
const qmy = require("qmy");

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

## Links

- [Twiter](https://twitter.com/onlyarth)
- [Github](https://github.com/4i8)
- [Documentation](#documentation)

## License

- [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)