use utf8; package Test::Schema::Result::MyTable; use Moo; extends 'DBIx::Class::Core'; has extra_attr => (is => 'rw', lazy => 1, default => sub{'hello, world'}); =head1 NAME Test::Schema::Result::MyTable =cut use strict; use warnings; use base 'DBIx::Class::Core'; =head1 TABLE: C =cut __PACKAGE__->table("MyTable"); =head1 ACCESSORS =head2 id data_type: 'integer' is_auto_increment: 1 is_nullable: 0 =head2 foo data_type: 'text' default_value: 'bar' is_nullable: 0 =cut __PACKAGE__->add_columns( "id", { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, "foo", { data_type => "text", default_value => "bar", is_nullable => 0 }, ); =head1 PRIMARY KEY =over 4 =item * L =back =cut __PACKAGE__->set_primary_key("id"); 1; #### use utf8; package Test::Schema; use strict; use warnings; use base 'DBIx::Class::Schema'; __PACKAGE__->load_namespaces; 1; #### use strict; use warnings; use feature 'say'; use Test::Schema; my $schema = Test::Schema->connect('dbi:SQLite:./test.db','',''); my $obj = $schema->resultset('MyTable')->find(1); say $obj->foo; say $obj->extra_attr; __END__ #### bar hello, world