use SQL::Translator::Utils 'parse_list_arg';
use Carp;
-with qw(
- SQL::Translator::Role::Error
- SQL::Translator::Role::BuildArgs
- SQL::Translator::Schema::Role::Extra
- SQL::Translator::Schema::Role::Compare
-);
+extends 'SQL::Translator::Schema::Object';
our $VERSION = '1.59';
use SQL::Translator::Types qw(schema_obj);
use List::MoreUtils qw(uniq);
-with qw(
- SQL::Translator::Role::Error
- SQL::Translator::Role::BuildArgs
- SQL::Translator::Schema::Role::Extra
- SQL::Translator::Schema::Role::Compare
-);
+extends 'SQL::Translator::Schema::Object';
our $VERSION = '1.59';
use SQL::Translator::Types qw(schema_obj);
use SQL::Translator::Utils qw(parse_list_arg ex2err throw);
-with qw(
- SQL::Translator::Role::Error
- SQL::Translator::Role::BuildArgs
- SQL::Translator::Schema::Role::Extra
- SQL::Translator::Schema::Role::Compare
-);
+extends 'SQL::Translator::Schema::Object';
our $VERSION = '1.59';
use SQL::Translator::Types qw(schema_obj);
use List::MoreUtils qw(uniq);
-with qw(
- SQL::Translator::Role::Error
- SQL::Translator::Role::BuildArgs
- SQL::Translator::Schema::Role::Extra
- SQL::Translator::Schema::Role::Compare
-);
+extends 'SQL::Translator::Schema::Object';
our $VERSION = '1.59';
--- /dev/null
+package SQL::Translator::Schema::Object;
+
+=head1 NAME
+
+SQL::Translator::Schema::Object - Base class for SQL::Translator schema objects
+
+=head1 SYNOPSIS
+
+ package SQL::Translator::Schema::Foo;
+ use Moo;
+ extends 'SQL::Translator::Schema::Object';
+
+=head1 DESCRIPTION
+
+Base class for Schema objects. A Moo class consuming the following
+roles.
+
+=over
+
+=item L<SQL::Translator::Role::Error>
+
+Provides C<< $obj->error >>, similar to L<Class::Base>.
+
+=item L<SQL::Translator::Role::BuildArgs>
+
+Removes undefined constructor arguments, for backwards compatibility.
+
+=item L<SQL::Translator::Schema::Role::Extra>
+
+Provides an C<extra> attribute storing a hashref of arbitrary data.
+
+=item L<SQL::Translator::Schema::Role::Compare>
+
+Provides an C<< $obj->equals($other) >> method for testing object
+equality.
+
+=back
+
+=cut
+
+use Moo;
+
+with qw(
+ SQL::Translator::Role::Error
+ SQL::Translator::Role::BuildArgs
+ SQL::Translator::Schema::Role::Extra
+ SQL::Translator::Schema::Role::Compare
+);
+
+1;
use SQL::Translator::Types qw(schema_obj);
use List::MoreUtils qw(uniq);
-with qw(
- SQL::Translator::Role::Error
- SQL::Translator::Role::BuildArgs
- SQL::Translator::Schema::Role::Extra
- SQL::Translator::Schema::Role::Compare
-);
+extends 'SQL::Translator::Schema::Object';
our $VERSION = '1.59';
use Carp::Clan '^SQL::Translator';
use List::Util 'max';
-with qw(
- SQL::Translator::Role::Error
- SQL::Translator::Role::BuildArgs
- SQL::Translator::Schema::Role::Extra
- SQL::Translator::Schema::Role::Compare
-);
+extends 'SQL::Translator::Schema::Object';
our $VERSION = '1.59';
use SQL::Translator::Types qw(schema_obj);
use List::MoreUtils qw(uniq);
-with qw(
- SQL::Translator::Role::Error
- SQL::Translator::Role::BuildArgs
- SQL::Translator::Schema::Role::Extra
- SQL::Translator::Schema::Role::Compare
-);
+extends 'SQL::Translator::Schema::Object';
our $VERSION = '1.59';
use SQL::Translator::Types qw(schema_obj);
use List::MoreUtils qw(uniq);
-with qw(
- SQL::Translator::Role::Error
- SQL::Translator::Role::BuildArgs
- SQL::Translator::Schema::Role::Extra
- SQL::Translator::Schema::Role::Compare
-);
+extends 'SQL::Translator::Schema::Object';
our $VERSION = '1.59';