# perldoc > Class::DBI::Column

---
type: CommandReference
command: Class::DBI::Column
mode: perldoc
section: ""
source: perldoc
---

## Quick Reference
- `Class::DBI::Column->new($name)` — create a new column object
- `$column->name` — column name
- `$column->groups` — list of group objects the column belongs to
- `$column->primary` (via `$colg->primary` on a group object) — whether column is primary
- `$column->in_database` — true if column exists in the database

## Name
Class::DBI::Column - A column in a table

## Synopsis
perl
my $column = Class::DBI::Column->new($name);
my $name   = $column->name;
my @groups = $column->groups;
my $pri_col = $colg->primary;
if ($column->in_database) { ... }
Each `Class::DBI` class manages its columns as class data. This module provides the interface; you probably should not interact with it directly.

## Methods
- `new($column)` — creates a new `Class::DBI::Column` object
- `name` — returns the column name
- `groups` — returns the group objects this column belongs to
- `primary` (on a group object) — returns whether this column is primary within its group
- `in_database` — returns true if the column exists in the database

## See Also
- [Class::DBI](https://metacpan.org/pod/Class::DBI)