@clickup/ent-framework
Version:
A PostgreSQL graph-database-alike library with microsharding and row-level security
18 lines • 747 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.escapeIdentComposite = escapeIdentComposite;
const escapeIdent_1 = require("../helpers/escapeIdent");
/**
* A pair for escapeComposite(), but works with a list of identifiers (e.g. list
* of unique key fields), not with values.
*
* - fields=["some_id"], table="tbl" => "tbl.some_id"
* - fields=["f1", "f2"], table="tbl" => "(tbl.f1,tbl.f2)"
*/
function escapeIdentComposite(fields, table) {
const list = fields
.map((k) => (table ? `${(0, escapeIdent_1.escapeIdent)(table)}.` : "") + (0, escapeIdent_1.escapeIdent)(k))
.join(",");
return fields.length > 1 ? `ROW(${list})` : list;
}
//# sourceMappingURL=escapeIdentComposite.js.map
;