Files
klz-cables.com/.pnpm-store/v10/files/0f/29e44acd8daf77c487f26ce525725e3a5cf5f628fb13584125f7b27784c886e1a71c5de1482920324a0b777cef24c8ee4da060fe99e695f35260278edeff9d
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

44 lines
1.3 KiB
Plaintext

import { entityKind } from "../../entity.js";
import { getColumnNameAndConfig } from "../../utils.js";
import { SingleStoreColumn, SingleStoreColumnBuilder } from "./common.js";
class SingleStoreVarBinaryBuilder extends SingleStoreColumnBuilder {
static [entityKind] = "SingleStoreVarBinaryBuilder";
/** @internal */
constructor(name, config) {
super(name, "string", "SingleStoreVarBinary");
this.config.length = config?.length;
}
/** @internal */
build(table) {
return new SingleStoreVarBinary(
table,
this.config
);
}
}
class SingleStoreVarBinary extends SingleStoreColumn {
static [entityKind] = "SingleStoreVarBinary";
length = this.config.length;
mapFromDriverValue(value) {
if (typeof value === "string") return value;
if (Buffer.isBuffer(value)) return value.toString();
const str = [];
for (const v of value) {
str.push(v === 49 ? "1" : "0");
}
return str.join("");
}
getSQLType() {
return this.length === void 0 ? `varbinary` : `varbinary(${this.length})`;
}
}
function varbinary(a, b) {
const { name, config } = getColumnNameAndConfig(a, b);
return new SingleStoreVarBinaryBuilder(name, config);
}
export {
SingleStoreVarBinary,
SingleStoreVarBinaryBuilder,
varbinary
};
//# sourceMappingURL=varbinary.js.map