1.2.2-Stable • Published 3 years ago
qmy v1.2.2-Stable
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
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
1.0.0-Stable
4 years ago
1.0.0-stable
4 years ago
1.1.5
3 years ago
1.2.1-Stable
3 years ago
1.2.2-Stable
3 years ago
1.1.1-Stable
3 years ago
1.1.0-Stable
3 years ago
0.2.2-beta
4 years ago
0.1.1-beta
4 years ago
0.0.1-security
4 years ago
0.1.0-beta
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.3
4 years ago
1.0.0
4 years ago