Honor Lee 6 years ago
parent
commit
fe785f406f
2 changed files with 0 additions and 32 deletions
  1. 0 21
      lib/mysql-pool.js
  2. 0 11
      lib/mysqldb.js

+ 0 - 21
lib/mysql-pool.js

@@ -1,21 +0,0 @@
-/**
- */
-var Mysql = require('mysql');  
-
-var pool;
-var client = {
-    getConnection:function(callback){
-        if(!pool) throw new Error("Mysql pool not created!");
-        if(!callback || typeof(callback)!='function') throw new Error("Mysql pool get connection lost callback!");
-        pool.getConnection(function(err,connection){
-            callback(err,connection);
-        });
-    },
-    end:function(){
-        pool.end();
-    }
-}
-exports.instance = function(config){
-    pool = Mysql.createPool(config)
-    return client;
-};

+ 0 - 11
lib/mysqldb.js

@@ -1,11 +0,0 @@
-'use strict'
-module.exports={
-    query:function(query,callback){
-        MysqlPool.getConnection(function(err,con){
-            con.query(query,function(err, results, fields) {  
-                con.release();
-                if(callback && typeof(callback)=='function') callback(err,results,fields);
-            });
-        });
-    }
-};