0.1.0 • Published 2 years ago

sql-simplified v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Information

  • Small NPM package that allows you to interact easier with your database.
  • Shortens your database query code up to 10 times!
  • MySQL pool and Promise-Object based, you are able to use .then, .catch etc.
  • Useful for people who keep their code clean and short.

Install

$ npm install sql-simplified

Basic Usage

const database = require('sql-simplified');


database.customQuery(`SELECT * FROM customers WHERE customerId = '1234'`).then(function(result) {

//SQL Query will be: `SELECT * FROM customers WHERE customerID = '1234'`

    console.log(result);
    /* Output:

    [
        RowDataPacket {
            customerId: 1234,
            customerName: 'Bob Andrew',
            phone: '123456789'
        }
    ]

    */
})

Functions

.customQuery(query)
// SQL Syntax: `YOUR OWN SYNTAX`

Requirements

You need a .env file with the following information in your project root directory:

SQLS_CONNECTIONLIMIT=100
SQLS_HOST=host
SQLS_PORT=port
SQLS_USER=user
SQLS_PASSWORD=password
SQLS_DATABASE=database

Contact

For question, suggestions, ideas etc, feel free to join my Discord server, or create an issue on GitHub.

0.1.0

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago