0.1.5 • Published 8 years ago

shaeiltajs v0.1.5

Weekly downloads
6
License
ISC
Repository
github
Last release
8 years ago

Shailta.JS

Node.js warper for mysql connection managing,singleton use of connection and query from files.

By Dor Shay (Poob)

Initalize:

  • sqlConfig : (Object) sql config data like in Connection options and optinal server name.
  • sqlFilesPath : (String) optinal default location for sql files.
  • isGlobal : (Boolean) optinal.
var shaeilta = require("shaeiltajs");

var sqlConfig = {
    "connectionLimit" : 5,
    "host" : "127.0.0.1",
	"user" : "root",
	"password" : "pwd",
	"database" : "blabla",
	"name" : "billingDB"
};
var sqlFilesPath = __dirname + '/sql';
var isGlobal = true;

var psql = shaeilta.addServer(sqlConfig,sqlFilesPath,isGlobal)

Unsing:

###query: Simpale query like normal mysql.

* psql.query('select 1 as test',function(err,data)
{
    if(err) throw err
    res.json(data)
})

###fileQuery :

  • Load sql from file, can be from givan path releative to path givin in addServer or start path with % will ignore default.
psql.fileQuery('loadTop20Custumers.sql',function(err,data)
{
    if(err) throw err
    res.json(data)
})

Using pool from another file

  • Need to add server naming to readme
var server = shaeilta.getSevrer('billingDB')
// Or get server defiend as global
var server = shaeilta.getGlobalSevrer()

dor@poob.me

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.9.9

8 years ago

0.9.8

8 years ago

0.9.7

8 years ago

0.9.6

8 years ago

0.9.5

8 years ago

0.9.4

8 years ago

0.9.3

8 years ago

0.9.2

8 years ago

0.9.1

8 years ago

0.9.0

8 years ago