import { entityKind } from "../../entity.js";
import { getColumnNameAndConfig } from "../../utils.js";
import { MsSqlColumnBuilderWithIdentity, MsSqlColumnWithIdentity } from "./common.js";
class MsSqlBigIntBuilder extends MsSqlColumnBuilderWithIdentity {
  static [entityKind] = "MsSqlBigIntBuilder";
  constructor(name, config) {
    super(name, "bigint", "MsSqlBigInt");
    this.config.mode = config.mode;
  }
  /** @internal */
  build(table) {
    return new MsSqlBigInt(
      table,
      this.config
    );
  }
}
class MsSqlBigInt extends MsSqlColumnWithIdentity {
  static [entityKind] = "MsSqlBigInt";
  mode = this.config.mode;
  getSQLType() {
    return `bigint`;
  }
  constructor(table, config) {
    super(table, config);
    this.mode = config.mode;
  }
  mapFromDriverValue(value) {
    return this.mode === "string" ? value.toString() : this.mode === "number" ? Number(value) : BigInt(value);
  }
}
function bigint(a, b) {
  const { name, config } = getColumnNameAndConfig(a, b);
  return new MsSqlBigIntBuilder(name, config);
}
export {
  MsSqlBigInt,
  MsSqlBigIntBuilder,
  bigint
};
//# sourceMappingURL=bigint.js.map