-
-
20 Jan 2021 07:24:38 UTC
- Distribution: DBIx-Class-Schema-Diff
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues
- Testers (683 / 7 / 0)
- Kwalitee
Bus factor: 2- 86.74% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (73.7KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
++ed by:3 non-PAUSE usersNAME
DBIx::Class::Schema::Diff::SchemaDiff - Data representation of schema for diffing
SYNOPSIS
use DBIx::Class::Schema::Diff::SchemaData; my $SD = DBIx::Class::Schema::Diff::SchemaData->new( schema => 'My::Schema' ); $SD = DBIx::Class::Schema::Diff::SchemaData->new( schema => $schema ); # Get hashref representation of schema: my $hashref = $SD->data; my $SD2 = DBIx::Class::Schema::Diff::SchemaData->new( data => $hashref ); # Dump as JSON to file: $SD2->dump_json_file('/path/to/schema_data.json');
DESCRIPTION
Object class representing a DBIx::Class::Schema. The
old_schema
andnew_schema
build params in DBIx::Class::Schema::Diff are dynamically coerced into objects of this class.This class can also be instantiated directly to dump/save the current schema data for later use by DBIx::Class::Schema::Diff (See its SYNOPSIS).
METHODS
new
Create a new DBIx::Class::Schema::Diff::SchemaData instance. The following build options are supported:
- schema
-
DBIx::Class schema supplied as a class name or connected object instance. If this param is supplied it will be used to build
data
. - data
-
Can be supplied instead of
schema
to use previously generated data.
dump_json
Returns
data
as a serialized JSON string.dump_json_file
Writes output of
dump_json()
to the supplied filename as long as it doesn't already exists. If the file already exists, an exception is thrown.prune
Accepts a list of one or more prune
keywords
and returns a newSchemaData
object with the specified information pruned/stripped from thedata
. Currently supported prune keywords:- isa
- constraints
- relationships
- columns
- private_col_attrs
fingerprint
Returns a sha1-based fingerprint string of the current data. Note that
prune
will result in different fingerprints. An example fingerprint isschemsum-448d754e40e09e0
. The 'schemsum' prefix is just for fun (and also provides an easy way to eyeball these values down the road).SEE ALSO
AUTHOR
Henry Van Styn <vanstyn@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by IntelliTree Solutions llc.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install DBIx::Class::Schema::Diff, copy and paste the appropriate command in to your terminal.
cpanm DBIx::Class::Schema::Diff
perl -MCPAN -e shell install DBIx::Class::Schema::Diff
For more information on module installation, please visit the detailed CPAN module installation guide.