simplifield-sql is a powerful Node.js module that allows you to easily interact with the MySQL Database.
Node.js 16.9.0 or newer is required.
npm install simplifield-sql
yarn add simplifield-sql
Install simplifield-sql:
npm install simplifield-sql
yarn add simplifield-sql
Create new database connection:
const Database = require("simplifield-sql");
const db = new Database({
user: "root",
host: "localhost",
database: "myowndatabase",
password: "mysecretshellpassword",
});
db.on("connect", (connection) => {
console.log(`Connected to ${connection.config.database} database 👌`);
});
And now you're able to insert, update and delete the database rows
Logs out, terminates the connection to Mysql, and destroys the client.
Returns: void
The speed of the database connection with the server
Returns: number
Array that contains all of the database tables
Returns: Table[]
To select a specific from the table
PARAMETER TYPE DESCRIPTION table string The mysql table condetions object The condetions of data updation Returns: Data?
To select all rows from the table using the data conditions
PARAMETER TYPE DESCRIPTION table string The mysql table condetions object The condetions of data updation Returns: Data[]
To insert new values on the table
PARAMETER TYPE DESCRIPTION table string The mysql table condetions object The condetions of data updation Returns: Data
To update a specific row in the table
PARAMETER TYPE DESCRIPTION table string The mysql table condetions object The condetions of data updation values object The new values Returns: Data
To delete a specific row from the table
PARAMETER TYPE DESCRIPTION table string The mysql table condetions object The condetions of data deletion Returns: boolean