1.0.0 • Published 8 years ago
mysql-assistant v1.0.0
Mysql-Assistant
Node module designed to generate dynamic sql queries
Getting Started
Installing
$ npm install mysql-assistant
Examples
var mysql-assistant = require("mysql-assistant");
table = 'user_table'
insertData = {id: '34', firstname: 'Sam', lastname: 'Smith'};
mysql-assistant.tableInsert(table, insertData, function(callback){
console.log(callback);
});
removeConditions = [{column: 'first_name', conditional: '=', value: 'Sam'},
{column: 'age', conditional: '>', value: '13'}];
mysqlAssistant.tableRemove(table, removeConditions, function(callback){
console.log(callback);
});
Methods
- connect(user, password, database, callback) - Connect to database
- listTables(callback) - Get tables in database
- getTableColumns(table, callback) - Get columns in database
- tableInsert(table, data, callback) - Insert into table
- tableRemove(table, data, callback) - Remove from table
Built With
- Mysql
Authors
- Sam Munroe
License
This project is licensed under the MIT License
1.0.0
8 years ago