NAME

DBIx::Class::MooseColumns - Lets you write DBIC add_column() definitions as attribute options

VERSION

Version 0.08

SYNOPSIS

package MyApp::Schema::Result::Artist;

use Moose;
use DBIx::Class::MooseColumns;
use namespace::autoclean;

extends 'DBIx::Class::Core';

has id => (
  isa => 'Int',
  is  => 'rw',
  add_column => {
    is_auto_increment => 1,
  },
);

has foo => (
  isa => 'Str',
  is  => 'rw',
  add_column => {
    data_type => 'datetime'
  },
);

has bar => (        # will call __PACKAGE__->add_column({})
  isa => 'Str',
  is  => 'rw',
  add_column => {
  },
);

has quux => (       # no __PACKAGE__->add_column() call
  isa => 'Str',
  is  => 'rw',
);

__PACKAGE__->meta->make_immutable(inline_constructor => 0);

1;

DISCLAIMER

This is ALPHA SOFTWARE. Use at your own risk. Features may change.

DESCRIPTION

This module allows you to put the arguments to "add_column" in DBIx::Class::ResultSource right into your attribute definitions and will automatically call it when it finds an add_column attribute option. It also replaces the DBIx::Class-generated accessor methods (these are Class::Accessor::Grouped-generated accessor methods under the hood) with the Moose-generated accessor methods so that you can use more of the wonderful powers of Moose (eg. type constraints, triggers, ...).

SEE ALSO

DBIx::Class, Moose

AUTHOR

Norbert Buchmuller, <norbi at nix.hu>

BUGS

Please report any bugs or feature requests to bug-dbix-class-moosecolumns at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DBIx-Class-MooseColumns. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc DBIx::Class::MooseColumns

You can also look for information at:

COPYRIGHT & LICENSE

Copyright 2010 Norbert Buchmuller, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.