According to
10f369208 Producer::Turnkey was retired back in 2004. It seems
that the ::Graph::* family exists solely for Turnkey infrastructure support
and as such can be deprecated. This frees us from a very old dependency
Class::MakeMethods (an early MOP attempt, not updated since 2003).
Fwiw Turnkey itself appears to be also dead:
http://sourceforge.net/mailarchive/forum.php?forum_name=turnkey-users
* Fix ignored option to script/sqlt-diagram (RT#5992)
* Fix t/17sqlfxml-producer.t failures due to whitespace differences introduced by
environment config snippets (RT#70786)
+* Deprecate SQL::Translator::Schema::Graph and the as_graph() schema method
# ----------------------------------------------------------
# 0.11010 2011-10-05
requires => {
'Class::Base' => 0,
'Class::Data::Inheritable' => 0.02,
- 'Class::MakeMethods' => 0,
'Digest::SHA' => 0,
'Carp::Clan' => 0,
'IO::Dir' => 0,
use SQL::Translator::Schema::View;
use SQL::Translator::Utils 'parse_list_arg';
+use Carp;
use base 'SQL::Translator::Schema::Object';
our $VERSION = '1.59';
return $self;
}
+# FIXME - to be removed, together with the SQL::Translator::Schema::Graph* stuff
+# looks like a remnant of the Turnkey project integration back in 2003-4
+# Appears to be quite dead
sub as_graph {
-=pod
-
-=head2 as_graph
+ eval { require Class::MakeMethods }
+ or croak 'You need to install the CPAN dependency Class::MakeMethods to use as_graph()';
-Returns the schema as an L<SQL::Translator::Schema::Graph> object.
-
-=cut
require SQL::Translator::Schema::Graph;
my $self = shift;
package SQL::Translator::Schema::Graph;
-
use strict;
use warnings;
+use Carp;
+carp(
+ 'SQL::Translator::Schema::Graph appears to be dead unmaintained and untested '
+. 'code. It will remain a part of the SQL::Translator distribution for some '
+. 'time, but eventually will be cleaned away. Please file a bug or contact the '
+. 'maintainers and let them know you are still using this functionality'
+);
+
+
use base 'Class::Base';
use Data::Dumper;
use strict;
use warnings;
-use Class::Base;
use base 'Class::Data::Inheritable';
use base 'Class::Base';
-use Class::MakeMethods::Utility::Ref qw( ref_compare );
+use Data::Dumper ();
our $VERSION = '1.59';
-
=head1 Construction
Derived classes should declare their attributes using the C<_attributes>
}
sub _compare_objects {
- my $self = shift;
- my $obj1 = shift;
- my $obj2 = shift;
- my $result = (ref_compare($obj1, $obj2) == 0);
+# my ($self, $obj1, $obj2) = @_;
+
+ my $result = (
+ Data::Dumper->new([$_[1]])->Terse(1)->Indent(0)->Deparse(1)->Sortkeys(1)->Maxdepth(0)->Dump
+ eq
+ Data::Dumper->new([$_[2]])->Terse(1)->Indent(0)->Deparse(1)->Sortkeys(1)->Maxdepth(0)->Dump
+ );
# if ( !$result ) {
# use Carp qw(cluck);
# cluck("How did I get here?");
parser => "PostgreSQL",
);
+ local $SIG{__WARN__} = sub {
+ warn @_ unless $_[0] =~ /SQL::Translator::Schema::Graph appears to be dead unmaintained and untested code/
+ };
+
ok( $tr->translate('t/data/pgsql/turnkey.sql'), 'Translate PG' );
ok( my $schema = $tr->schema, 'Got Schema' );
ok( my $graph = $schema->as_graph, 'Graph made');