@gravitybot/sql
v1.8.2
Published
@gravitybot/sql Is a simple module that includes simplified functions of the mysql module
Downloads
46
Maintainers
Readme
Gravitybot SQL !
Installation
npm install @gravitybot/sql
Required
How to use?
@gravitybot/sql Is a simple module that includes simplified functions of the mysql module
This is an example usage of our package
// Import the module
const mysql = require("@gravitybot/sql");
// Create a connection
mysql.createConnection({
host: "localhost",
user: "root",
database: "test",
password: "mysecretpassword",
});
// Create a Model
const user = new mysql.Model("users", {
// Default Values
userId: 1,
username: "User",
age: 18,
});
// Export data from Model
const me = await user.findOne({ username: "eyun-dev" });
// Console the data
console.log(me);
CONSOLE:
{
userId: 1,
username: "eyun-dev",
age: 18
}