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