import { entityKind } from "../../entity.js";
import { CockroachColumn, CockroachColumnWithArrayBuilder } from "./common.js";
class CockroachRealBuilder extends CockroachColumnWithArrayBuilder {
  static [entityKind] = "CockroachRealBuilder";
  constructor(name, length) {
    super(name, "number", "CockroachReal");
    this.config.length = length;
  }
  /** @internal */
  build(table) {
    return new CockroachReal(
      table,
      this.config
    );
  }
}
class CockroachReal extends CockroachColumn {
  static [entityKind] = "CockroachReal";
  constructor(table, config) {
    super(table, config);
  }
  getSQLType() {
    return "real";
  }
  mapFromDriverValue = (value) => {
    if (typeof value === "string") {
      return Number.parseFloat(value);
    }
    return value;
  };
}
function real(name) {
  return new CockroachRealBuilder(name ?? "");
}
export {
  CockroachReal,
  CockroachRealBuilder,
  real
};
//# sourceMappingURL=real.js.map