diff options
author | Joel Kronqvist <work.joelkronqvist@pm.me> | 2022-03-11 20:46:06 +0200 |
---|---|---|
committer | Joel Kronqvist <work.joelkronqvist@pm.me> | 2022-03-11 20:46:06 +0200 |
commit | 080c5819d87b933816d724a83f3bf4f1686770a7 (patch) | |
tree | 4a2ccc68b27edf7d4cbc586c932cc7542b655e19 /node_modules/mysql2/index.js | |
parent | 5ac7049a9d30733165cc212dee308163c2a14644 (diff) | |
parent | d003b82235a9329f912522a2f70aa950dfce4998 (diff) | |
download | LYLLRuoka-080c5819d87b933816d724a83f3bf4f1686770a7.tar.gz LYLLRuoka-080c5819d87b933816d724a83f3bf4f1686770a7.zip |
Merge branch 'master' of https://github.com/JoelHMikael/FoodJS
Updating remote changes
Diffstat (limited to 'node_modules/mysql2/index.js')
-rw-r--r-- | node_modules/mysql2/index.js | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/node_modules/mysql2/index.js b/node_modules/mysql2/index.js new file mode 100644 index 0000000..cd9601e --- /dev/null +++ b/node_modules/mysql2/index.js @@ -0,0 +1,81 @@ +'use strict'; + +const SqlString = require('sqlstring'); + +const Connection = require('./lib/connection.js'); +const ConnectionConfig = require('./lib/connection_config.js'); +const parserCache = require('./lib/parsers/parser_cache'); + +exports.createConnection = function(opts) { + return new Connection({ config: new ConnectionConfig(opts) }); +}; + +exports.connect = exports.createConnection; +exports.Connection = Connection; + +const Pool = require('./lib/pool.js'); +const PoolCluster = require('./lib/pool_cluster.js'); + +exports.createPool = function(config) { + const PoolConfig = require('./lib/pool_config.js'); + return new Pool({ config: new PoolConfig(config) }); +}; + +exports.createPoolCluster = function(config) { + const PoolCluster = require('./lib/pool_cluster.js'); + return new PoolCluster(config); +}; + +exports.createQuery = Connection.createQuery; + +exports.Pool = Pool; + +exports.PoolCluster = PoolCluster; + +exports.createServer = function(handler) { + const Server = require('./lib/server.js'); + const s = new Server(); + if (handler) { + s.on('connection', handler); + } + return s; +}; + +exports.PoolConnection = require('./lib/pool_connection'); +exports.escape = SqlString.escape; +exports.escapeId = SqlString.escapeId; +exports.format = SqlString.format; +exports.raw = SqlString.raw; + +exports.__defineGetter__( + 'createConnectionPromise', + () => require('./promise.js').createConnection +); + +exports.__defineGetter__( + 'createPoolPromise', + () => require('./promise.js').createPool +); + +exports.__defineGetter__( + 'createPoolClusterPromise', + () => require('./promise.js').createPoolCluster +); + +exports.__defineGetter__('Types', () => require('./lib/constants/types.js')); + +exports.__defineGetter__('Charsets', () => + require('./lib/constants/charsets.js') +); + +exports.__defineGetter__('CharsetToEncoding', () => + require('./lib/constants/charset_encodings.js') +); + +exports.setMaxParserCache = function(max) { + parserCache.setMaxCache(max); +}; + +exports.clearParserCache = function() { + parserCache.clearCache(); +}; |