smc-hub
Version:
CoCalc: Backend webserver component
56 lines (55 loc) • 2.23 kB
JavaScript
;
/*
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
*/
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
var e_1, _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.db = exports.PUBLIC_PROJECT_COLUMNS = exports.PROJECT_COLUMNS = exports.count_result = exports.all_results = exports.one_result = exports.expire_time = exports.pg_type = void 0;
/*
PostgreSQL database entry point.
Do not import any of the submodules directly unless you
know exactly what you're doing.
COPYRIGHT : (c) 2021 SageMath, Inc.
*/
var base = require("./postgres-base");
exports.pg_type = base.pg_type, exports.expire_time = base.expire_time, exports.one_result = base.one_result, exports.all_results = base.all_results, exports.count_result = base.count_result, exports.PROJECT_COLUMNS = base.PROJECT_COLUMNS, exports.PUBLIC_PROJECT_COLUMNS = base.PUBLIC_PROJECT_COLUMNS;
// Add further functionality to PostgreSQL class -- must be at the bottom of this file.
// Each of the following calls composes the PostgreSQL class with further important functionality.
// Order matters.
var PostgreSQL = base.PostgreSQL;
try {
for (var _b = __values([
"server-queries",
"blobs",
"synctable",
"user-queries",
"ops",
]), _c = _b.next(); !_c.done; _c = _b.next()) {
var module_1 = _c.value;
PostgreSQL = require("smc-hub/postgres-" + module_1).extend_PostgreSQL(PostgreSQL);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
function db(opts) {
return new PostgreSQL(opts);
}
exports.db = db;
//# sourceMappingURL=postgres.js.map