How to use the mysql2.Types function in mysql2

To help you get started, we’ve selected a few mysql2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sasha-alias / sqltabs / src / connectors / mysql / Database.js View on Github external
var async = require('async');
var mysql = require('mysql2');
var url = require('url');
var Words = require('./keywords.js');

var Clients = {};
var InfoClients = {};

var Types = [];
for (var type in mysql.Types) {
	Types[mysql.Types[type]] = type;
}

var parse_connstr = function(connstr){

    if (connstr.indexOf('---') > 0){
        connstr = connstr.split('---')[0];
    }

    var parsed = url.parse(connstr);

    var database = '';
    if (parsed.pathname != 'undefined' && parsed.pathname != null){
        database = parsed.pathname.substring(1);
    }

    var user = '';
github sasha-alias / sqltabs / src / connectors / mysql / Database.js View on Github external
var async = require('async');
var mysql = require('mysql2');
var url = require('url');
var Words = require('./keywords.js');

var Clients = {};
var InfoClients = {};

var Types = [];
for (var type in mysql.Types) {
	Types[mysql.Types[type]] = type;
}

var parse_connstr = function(connstr){

    if (connstr.indexOf('---') > 0){
        connstr = connstr.split('---')[0];
    }

    var parsed = url.parse(connstr);

    var database = '';
    if (parsed.pathname != 'undefined' && parsed.pathname != null){
        database = parsed.pathname.substring(1);
    }