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