import { entityKind } from "../../entity.js";
import { CockroachColumn } from "./common.js";
import { CockroachIntColumnBaseBuilder } from "./int.common.js";
class CockroachIntegerBuilder extends CockroachIntColumnBaseBuilder {
  static [entityKind] = "CockroachIntegerBuilder";
  constructor(name) {
    super(name, "number", "CockroachInteger");
  }
  /** @internal */
  build(table) {
    return new CockroachInteger(
      table,
      this.config
    );
  }
}
class CockroachInteger extends CockroachColumn {
  static [entityKind] = "CockroachInteger";
  getSQLType() {
    return "int4";
  }
  mapFromDriverValue(value) {
    if (typeof value === "string") {
      return Number.parseInt(value);
    }
    return value;
  }
}
function int4(name) {
  return new CockroachIntegerBuilder(name ?? "");
}
export {
  CockroachInteger,
  CockroachIntegerBuilder,
  int4
};
//# sourceMappingURL=integer.js.map