Files
klz-cables.com/.pnpm-store/v10/files/e8/054f2339579080c1eeafc00ed2ac3a3809e9298ba496a8faa1f5881599bf6ac7e499d3564c91d1d0ea382dcc2a82b742cb232a4bb4837213309e5a4fad0376
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

86 lines
2.2 KiB
Plaintext

import { entityKind } from "../../entity.js";
import { getColumnNameAndConfig } from "../../utils.js";
import { SQLiteColumn, SQLiteColumnBuilder } from "./common.js";
class SQLiteNumericBuilder extends SQLiteColumnBuilder {
static [entityKind] = "SQLiteNumericBuilder";
constructor(name) {
super(name, "string", "SQLiteNumeric");
}
/** @internal */
build(table) {
return new SQLiteNumeric(
table,
this.config
);
}
}
class SQLiteNumeric extends SQLiteColumn {
static [entityKind] = "SQLiteNumeric";
mapFromDriverValue(value) {
if (typeof value === "string") return value;
return String(value);
}
getSQLType() {
return "numeric";
}
}
class SQLiteNumericNumberBuilder extends SQLiteColumnBuilder {
static [entityKind] = "SQLiteNumericNumberBuilder";
constructor(name) {
super(name, "number", "SQLiteNumericNumber");
}
/** @internal */
build(table) {
return new SQLiteNumericNumber(
table,
this.config
);
}
}
class SQLiteNumericNumber extends SQLiteColumn {
static [entityKind] = "SQLiteNumericNumber";
mapFromDriverValue(value) {
if (typeof value === "number") return value;
return Number(value);
}
mapToDriverValue = String;
getSQLType() {
return "numeric";
}
}
class SQLiteNumericBigIntBuilder extends SQLiteColumnBuilder {
static [entityKind] = "SQLiteNumericBigIntBuilder";
constructor(name) {
super(name, "bigint", "SQLiteNumericBigInt");
}
/** @internal */
build(table) {
return new SQLiteNumericBigInt(
table,
this.config
);
}
}
class SQLiteNumericBigInt extends SQLiteColumn {
static [entityKind] = "SQLiteNumericBigInt";
mapFromDriverValue = BigInt;
mapToDriverValue = String;
getSQLType() {
return "numeric";
}
}
function numeric(a, b) {
const { name, config } = getColumnNameAndConfig(a, b);
const mode = config?.mode;
return mode === "number" ? new SQLiteNumericNumberBuilder(name) : mode === "bigint" ? new SQLiteNumericBigIntBuilder(name) : new SQLiteNumericBuilder(name);
}
export {
SQLiteNumeric,
SQLiteNumericBigInt,
SQLiteNumericBigIntBuilder,
SQLiteNumericBuilder,
SQLiteNumericNumber,
SQLiteNumericNumberBuilder,
numeric
};
//# sourceMappingURL=numeric.js.map