Skip to content

i-tsx/simplifield-sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm version node-current chat-online npm downloads


About

simplifield-sql is a powerful Node.js module that allows you to easily interact with the MySQL Database.


Installation

Node.js 16.9.0 or newer is required.

npm install simplifield-sql
yarn add simplifield-sql

Example usage

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


Methods

Connections

Tables

Rows


Documents

Connections

Logs out, terminates the connection to Mysql, and destroys the client.

Returns: void

The speed of the database connection with the server

Returns: number

Tables

Array that contains all of the database tables

Returns: Table[]

Rows

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published