TenantAtlas/apps/platform/.pnpm-store/v10/files/26/ba4efc60d38eeeb2141b5c19ad3b541f39059e1a15ff3c6795f60061411cfd8f683557a657af6cd7be5518ad3b703ebba4bc5bd3b68ce33d9b0eb0b4476b33
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

36 lines
1.0 KiB
Plaintext

import { entityKind } from "../../entity.js";
import { getColumnNameAndConfig } from "../../utils.js";
import { SingleStoreColumn, SingleStoreColumnBuilder } from "./common.js";
class SingleStoreCharBuilder extends SingleStoreColumnBuilder {
static [entityKind] = "SingleStoreCharBuilder";
constructor(name, config) {
super(name, "string", "SingleStoreChar");
this.config.length = config.length;
this.config.enum = config.enum;
}
/** @internal */
build(table) {
return new SingleStoreChar(
table,
this.config
);
}
}
class SingleStoreChar extends SingleStoreColumn {
static [entityKind] = "SingleStoreChar";
length = this.config.length;
enumValues = this.config.enum;
getSQLType() {
return this.length === void 0 ? `char` : `char(${this.length})`;
}
}
function char(a, b = {}) {
const { name, config } = getColumnNameAndConfig(a, b);
return new SingleStoreCharBuilder(name, config);
}
export {
SingleStoreChar,
SingleStoreCharBuilder,
char
};
//# sourceMappingURL=char.js.map