MCPcopy Index your code
hub / github.com/dresende/node-orm2 / use

Function use

lib/ORM.js:141–162  ·  view source on GitHub ↗
(connection, proto, opts, cb)

Source from the content-addressed store, hash-verified

139exports.connectAsync = Promise.promisify(exports.connect, { context: exports });
140
141var use = function (connection, proto, opts, cb) {
142 if (DriverAliases[proto]) {
143 proto = DriverAliases[proto];
144 }
145 if (typeof opts === "function") {
146 cb = opts;
147 opts = {};
148 }
149
150 try {
151 var Driver = adapters.get(proto);
152 var settings = new Settings.Container(exports.settings.get('*'));
153 var driver = new Driver(null, connection, {
154 debug : (opts.query && opts.query.debug === 'true'),
155 settings : settings
156 });
157
158 return cb(null, new ORM(proto, driver, settings));
159 } catch (ex) {
160 return cb(ex);
161 }
162}
163
164exports.Text = Query.Text;
165for (var k in Query.Comparators) {

Callers

nothing calls this directly

Calls 2

cbFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected