node package manager
Orgs are free. Discover, share, and reuse code in your team. Create a free org »

mysql_abs

node-mysql-abs

An abstraction layer for mysql from nodejs

This is still pre-alpha. It only has select and insert capabilities.

Wait a little.

Installation

npm install mysql_abs

Usage

 
var connection = {
    user : 'root',
    password : 'root'
};
 
var db_name = "test";
 
var client = require('mysql-abs').connect(connection, db_name);
 
var select_options = {
    where : {
        'user' : 'bvaldivielso'
    },
    order_by : [
        ["created_at", "DESC"],
        ["id" , "DESC"]
    ]
};
 
client.select("comments", select_options, function(err, data){
    console.log(data);
});

Or maybe

...
var insert_data = [
    {"content" : "Hello world", user : "bvaldivielso"},
    {"content" : "Good bye world", user : "troll", hide : "1"}
];
client.insert("comments", insert_data);