sql-client
Version:
A dirt-simple SQL client abstraction (currently) supporting PostgreSQL, MySQL and SQLite.
42 lines (34 loc) • 1.42 kB
JavaScript
// Generated by CoffeeScript 2.6.0
(function() {
var conditional_sources, container, err, export_source_file, file, i, j, len, len1, required_module, sources;
export_source_file = function(file, container) {
var exported, k, results, target, v;
target = module.exports != null ? module.exports : module.exports = {};
if (container != null) {
target = target[container] != null ? target[container] : target[container] = {};
}
exported = require(file);
results = [];
for (k in exported) {
v = exported[k];
results.push(target[k] = v);
}
return results;
};
sources = ['./connection-factory', './sql-client', './sql-client-pool', './sql-runner'];
for (i = 0, len = sources.length; i < len; i++) {
file = sources[i];
export_source_file(file);
}
conditional_sources = [['pg', './postgresql-client'], ['pg', './bin/postgresql-runner', 'bin'], ['mysql', './mysql-client'], ['mysql', './bin/mysql-runner', 'bin'], ['sqlite3', './sqlite3-client'], ['sqlite3', './bin/sqlite3-runner', 'bin']];
for (j = 0, len1 = conditional_sources.length; j < len1; j++) {
[required_module, file, container] = conditional_sources[j];
try {
require(required_module);
export_source_file(file, container);
} catch (error) {
err = error;
}
}
// ignored; required module not available so do not load source file
}).call(this);