Files
klz-cables.com/.pnpm-store/v10/files/f7/fad389df9ffb1cbbcc7c2aad5cef23a34d593df83aacd8476e417ef69d60936ccb3ee6902735f50cf900f2f5b2537e261310fdcb7e11bb5b9fbbd0ebf9f096
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

46 lines
1.3 KiB
Plaintext

import { entityKind } from "../../entity.js";
import { getColumnNameAndConfig } from "../../utils.js";
import { SingleStoreColumn, SingleStoreColumnBuilder } from "./common.js";
class SingleStoreVectorBuilder extends SingleStoreColumnBuilder {
static [entityKind] = "SingleStoreVectorBuilder";
constructor(name, config) {
super(name, "array", "SingleStoreVector");
this.config.dimensions = config.dimensions;
this.config.elementType = config.elementType;
}
/** @internal */
build(table) {
return new SingleStoreVector(
table,
this.config
);
}
/** @internal */
generatedAlwaysAs(as, config) {
throw new Error("not implemented");
}
}
class SingleStoreVector extends SingleStoreColumn {
static [entityKind] = "SingleStoreVector";
dimensions = this.config.dimensions;
elementType = this.config.elementType;
getSQLType() {
return `vector(${this.dimensions}, ${this.elementType || "F32"})`;
}
mapToDriverValue(value) {
return JSON.stringify(value);
}
mapFromDriverValue(value) {
return JSON.parse(value);
}
}
function vector(a, b) {
const { name, config } = getColumnNameAndConfig(a, b);
return new SingleStoreVectorBuilder(name, config);
}
export {
SingleStoreVector,
SingleStoreVectorBuilder,
vector
};
//# sourceMappingURL=vector.js.map