---
name: "Jifty::DBI::Column"
section: "3pm"
platform: "linux"
package: "libjifty-dbi-perl"
version: "0.78-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Jifty::DBI::Column"
---

# Jifty::DBI::Column(3pm)

Encapsulates a single column in a Jifty::DBI::Record table

## NAME

Jifty::DBI::Column - Encapsulates a single column in a Jifty::DBI::Record table

## DESCRIPTION

This class encapsulates a single column in a Jifty::DBI::Record table description. It replaces the \_accessible method in Jifty::DBI::Record.

It has the following accessors: `"name type default validator boolean` `refers_to readable writable length"`.

### new

### is\_numeric

Returns true if the column is of some numeric type, otherwise returns false.

### is\_string

Returns true if this column is a text field

### is\_boolean

Returns true if this column is a boolean

### serialize\_metadata

Returns a hash describing this column object with enough detail to fully describe it in the database.  Intentionally skips `"record_class"`, all column attributes starting with `"_"`, and all column attributes which are undefined.  The "known" attributes in the `"attributes"` hash are flattened and returned as well.  The list of known attributes are:

- container

  - label hints render\_as

  - display\_length

  - valid\_values

  - available\_values

  - autocompleted

  - documentation

  - no\_placeholder

  Setting this to a true value causes "load\_by\_cols" in Jifty::DBI::record to not use a placeholder when loading the column.  This can allow the database to come up with better query plans in some cases.

### serialize\_metadata2

Returns a hash describing this column object with enough detail to fully describe it in the database.  Intentionally skips `"record_class"`, all column attributes starting with `"_"`, and all column attributes which are undefined.

### validator

Gets/sets the validator coderef for the column.

### read

DEPRECATED.  Use `"$column->readable"` instead.

### write

DEPRECATED.  Use `"$column->writable"` instead.

### length

DEPRECATED.  Use `"$column->max_length"` instead.

### until

DEPRECATED.  Use `"$column->till"` instead.

### active

Returns the a true value if the column method exists for the current application version. The current application version is determined by checking the "schema\_version" in Jifty::DBI::Record of the column's "record\_class". This method returns a false value if the column is not yet been added or has been dropped.

This method returns a false value under these circumstances:

- •

  Both the `"since"` trait and `"schema_version"` method are defined and `"schema_version"` is less than the version set on `"since"`.

- •

  Both the `"till"` trait and `"schema_version"` method are defined and `"schema_version"` is greater than or equal to the version set on `"till"`.

Otherwise, this method returns true.
