Files
klz-cables.com/.pnpm-store/v10/files/22/696539764ebeb2930a991daac4012059dc03191969c6d69dab9abb35013bc2e29e3306c658126b7ab229a807e54490cdaa8d22698f161f0121e771f8976314
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

43 lines
913 B
Plaintext

import { entityKind } from "../../entity.js";
import { PgColumn, PgColumnBuilder } from "./common.js";
class PgJsonbBuilder extends PgColumnBuilder {
static [entityKind] = "PgJsonbBuilder";
constructor(name) {
super(name, "json", "PgJsonb");
}
/** @internal */
build(table) {
return new PgJsonb(table, this.config);
}
}
class PgJsonb extends PgColumn {
static [entityKind] = "PgJsonb";
constructor(table, config) {
super(table, config);
}
getSQLType() {
return "jsonb";
}
mapToDriverValue(value) {
return JSON.stringify(value);
}
mapFromDriverValue(value) {
if (typeof value === "string") {
try {
return JSON.parse(value);
} catch {
return value;
}
}
return value;
}
}
function jsonb(name) {
return new PgJsonbBuilder(name ?? "");
}
export {
PgJsonb,
PgJsonbBuilder,
jsonb
};
//# sourceMappingURL=jsonb.js.map