index.js 871 B

123456789101112131415161718192021222324252627
  1. var Connection = require('./lib/Connection');
  2. var ConnectionConfig = require('./lib/ConnectionConfig');
  3. var Types = require('./lib/protocol/constants/types');
  4. var SqlString = require('./lib/protocol/SqlString');
  5. var Pool = require('./lib/Pool');
  6. var PoolConfig = require('./lib/PoolConfig');
  7. var PoolCluster = require('./lib/PoolCluster');
  8. exports.createConnection = function(config) {
  9. return new Connection({config: new ConnectionConfig(config)});
  10. };
  11. exports.createPool = function(config) {
  12. return new Pool({config: new PoolConfig(config)});
  13. };
  14. exports.createPoolCluster = function(config) {
  15. return new PoolCluster(config);
  16. };
  17. exports.createQuery = Connection.createQuery;
  18. exports.Types = Types;
  19. exports.escape = SqlString.escape;
  20. exports.escapeId = SqlString.escapeId;
  21. exports.format = SqlString.format;