import { entityKind } from "../../entity.js";
import { MsSqlColumnBuilderWithIdentity, MsSqlColumnWithIdentity } from "./common.js";
class MsSqlSmallIntBuilder extends MsSqlColumnBuilderWithIdentity {
  static [entityKind] = "MsSqlSmallIntBuilder";
  constructor(name) {
    super(name, "number", "MsSqlSmallInt");
  }
  /** @internal */
  build(table) {
    return new MsSqlSmallInt(
      table,
      this.config
    );
  }
}
class MsSqlSmallInt extends MsSqlColumnWithIdentity {
  static [entityKind] = "MsSqlSmallInt";
  getSQLType() {
    return `smallint`;
  }
  mapFromDriverValue(value) {
    if (typeof value === "string") {
      return Number(value);
    }
    return value;
  }
}
function smallint(name) {
  return new MsSqlSmallIntBuilder(name ?? "");
}
export {
  MsSqlSmallInt,
  MsSqlSmallIntBuilder,
  smallint
};
//# sourceMappingURL=smallint.js.map