
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
mysql-easy-basic-crud
Advanced tools
mysql-easy-basic-crud is simple crud implemenation with node.js mysql driver.
mysql-easy-basic-crud is simple crud implemenation with node.js mysql driver.
Install via npm.
$ npm install --save mysql-easy-basic-crud
"use strict";
const DBPool = require('mysql-easy-basic-crud');
const dbPool = new DBPool({
connectionLimit: 20,
host: 'localhost',
port: 3306,
user: 'test',
password: 'test',
database: 'test',
});
dbPool.create();
let pool = null;
dbPool.get()
.then((ins) => {
pool = ins;
return pool.table('Users').get();
})
.then((rows) => {
console.log(rows);
})
.catch((err) => {
console.error(err);
});
Every API function returns Promise object.
Create new DBPool instance. Possible options are check node-mysql. It uses mysql2 module internally.
Create new pool.
Release the pool. Be sure to call this before application ends.
Get pool connection. Returning value is promise. Parameter passed by promise is DBPoolInstance type object which has plenty of utility functions.
Release the connection.
Set the table you want to CRUD. This must be call before using CRUD methods.
Check matched data is exists in table.
Count how many rows are in specified conditions. This method is useful for implementing paginating.
Get matched row(s). Available options are:
Create new record.
Update matched record(s).
Delete matched record(s).
Begin the transaction.
Commit the transaction.
Rollback the transaction.
Execute normal SQL string.
dbPool.get()
.then((conn) => {
return conn.table('Users').get();
})
.then((rows) => {
console.log(rows);
});
dbPool.get()
.then((conn) => {
return conn.table('Users').get({
name: '.modernator'
});
})
.then((rows) => {
console.log(rows);
});
dbPool.get()
.then((conn) => {
return conn.table('Users').get({}, {
order: {
id: 1 // DESC
}
});
})
.then((rows) => {
console.log(rows);
});
dbPool.get()
.then((conn) => {
return conn.table('Users').create({
userid: 'entvy',
age: 25
});
})
.then((result) => {
console.log(result.insertId);
});
dbPool.get()
.then((conn) => {
return conn.table('Users').update({
userid: 'entvy'
}, {
age: 27
});
});
dbPool.get()
.then((conn) => {
return conn.table('Users').delete({
userid: 'entvy'
});
});
MIT.
FAQs
mysql-easy-basic-crud is simple crud implemenation with node.js mysql driver.
The npm package mysql-easy-basic-crud receives a total of 1 weekly downloads. As such, mysql-easy-basic-crud popularity was classified as not popular.
We found that mysql-easy-basic-crud demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.