import { entityKind } from "../../entity.js";
import { getColumnNameAndConfig } from "../../utils.js";
import { MsSqlColumn, MsSqlColumnBuilder } from "./common.js";
class MsSqlBinaryBuilder extends MsSqlColumnBuilder {
  static [entityKind] = "MsSqlBinaryBuilder";
  constructor(name, length) {
    super(name, "buffer", "MsSqlBinary");
    this.config.length = length;
  }
  /** @internal */
  build(table) {
    return new MsSqlBinary(table, this.config);
  }
}
class MsSqlBinary extends MsSqlColumn {
  static [entityKind] = "MsSqlBinary";
  length = this.config.length;
  getSQLType() {
    return this.length === void 0 ? `binary` : `binary(${this.length})`;
  }
}
function binary(a, b = {}) {
  const { name, config } = getColumnNameAndConfig(a, b);
  return new MsSqlBinaryBuilder(name, config.length);
}
export {
  MsSqlBinary,
  MsSqlBinaryBuilder,
  binary
};
//# sourceMappingURL=binary.js.map