TenantAtlas/apps/platform/.pnpm-store/v10/files/9a/05e85f5d50cedfff2edd50b51845dc774af3d2961317d9f4a6c3744a8448ea01d569dc036cc6baaabd7f815411242906a26ef0a67401ce23c427d14a6aab5a
Ahmed Darrazi 9f74f7a658
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 51s
feat: compress governance operator outcomes
2026-04-19 14:15:11 +02:00

39 lines
1.2 KiB
Plaintext

import { entityKind } from "../../entity.js";
import { getColumnNameAndConfig } from "../../utils.js";
import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from "./common.js";
class MySqlRealBuilder extends MySqlColumnBuilderWithAutoIncrement {
static [entityKind] = "MySqlRealBuilder";
constructor(name, config) {
super(name, "number", "MySqlReal");
this.config.precision = config?.precision;
this.config.scale = config?.scale;
}
/** @internal */
build(table) {
return new MySqlReal(table, this.config);
}
}
class MySqlReal extends MySqlColumnWithAutoIncrement {
static [entityKind] = "MySqlReal";
precision = this.config.precision;
scale = this.config.scale;
getSQLType() {
if (this.precision !== void 0 && this.scale !== void 0) {
return `real(${this.precision}, ${this.scale})`;
} else if (this.precision === void 0) {
return "real";
} else {
return `real(${this.precision})`;
}
}
}
function real(a, b = {}) {
const { name, config } = getColumnNameAndConfig(a, b);
return new MySqlRealBuilder(name, config);
}
export {
MySqlReal,
MySqlRealBuilder,
real
};
//# sourceMappingURL=real.js.map