1.2.0 • Published 6 years ago

mothi v1.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

Node-Mysql-Wrapper

Adapt the library by following steps :

  • Install dotenv module and create .env file in root level of the project.
  • Configure following variables :
    • TTDB_MODE --> dev/prod
    • TTDB_HOST_DEV --> development host database IP
    • TTDB_USER_DEV --> user name of development database
    • TTDB_PW_DEV --> password of development environment
    • TTDB_DEV --> development database name
    • TTDB_HOST_PROD --> production host database IP
    • TTDB_USER_PROD --> user name of production database
    • TTDB_PW_PROD --> password of production environment
    • TTDB_PROD --> production database name
    • TT_PORT --> port number
  • Import the module using var mothi = require('mothi')
  • Use following APIs to operate on MySQL database.
    • insertQuery(table, row, done) --> Insert new row into table with done as callback.
    • updateQuery(table, row, where, done) --> Update row using where clause in table with done as callback.
    • findQuery(table, where, done) --> Find in table using where with done as callback.
    • deleteQuery(table, row, done) --> Delete row from table with done as callback.
    • fetchTableQuery(table, done) --> Get all the rows from table with done as callback.
    • customQuery(query, valueArray, done) --> Execute customized query using valueArray with done as callback.

To run test follow below steps :

  • Install Mysql software
  • Create a database with name 'test' (CLI : mysql -u {username} -p and provide {passeword} and then call "create database test")
  • Create a table name 'test'.

This should be sufficient to run test suite.

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

7 years ago