DBIx::C...hemaData(3)
π DBIx::Class::Schema::Diff::SchemaData π
okay so bestie, this is a page from the User Contributed Perl Documentation (perl v5.42.0, dated 2025-07-25, no big deal) and it's about DBIx::Class::Schema::Diff::SchemaData β literally the little data-holder that lets you diff your schemas. sit down, get a snack π, we're doing this.
β¨ NAME β¨
DBIx::Class::Schema::Diff::SchemaDiff β Data representation of schema for diffing
not me noticing the NAME line saysSchemaDiffwhile literally everything else on this page is aboutSchemaDataπ we are keeping that exactly as the author wrote it, no cap. the vibe is intact, the facts are intact.
π 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');
likeβ¦ look at her. build it from a schema class name, build it from a connected object, grab the hashref, feed the hashref back in, dump it to JSON. iconic behavior honestly π
π¦ DESCRIPTION π¦
so this is an object class that represents a DBIx::Class::Schema. that's the whole assignment.
the old_schema and new_schema build params over in DBIx::Class::Schema::Diff get dynamically coerced into objects of this class β they just kindaβ¦ become one, no manual labor required, we love a glow-up β¨
but you can also instantiate this class directly, which is the move if you wanna dump/save your current schema data for later use by DBIx::Class::Schema::Diff (peep its SYNOPSIS for that, bestie).
π METHODS π
πΈ new
creates a new DBIx::Class::Schema::Diff::SchemaData instance. the following build options are supported:
schemaβ a DBIx::Class schema, handed over as either a class name or a connected object instance. if you supply this param, it gets used to builddata.dataβ you can supply this instead ofschemaif you're rolling with previously generated data.
πΈ dump_json
returns data as a serialized JSON string. that's it, that's the whole thing π
πΈ dump_json_file
writes the output of dump_json() to the filename you give it β as long as that file doesn't already exist. if the file already exists, an exception is thrown. so likeβ¦ don't be messy about it π
πΈ prune
accepts a list of one or more prune "keywords" and returns a new SchemaData object with the specified information pruned/stripped out of the data. currently supported prune keywords, in all their glory:
isaconstraintsrelationshipscolumnsprivate_col_attrs
πΈ fingerprint
returns a sha1-based fingerprint string of the current data. lowkey important: prune will result in different fingerprints, so don't come crying when the numbers don't match up π
an example fingerprint is schemsum-448d754e40e09e0. the schemsum prefix is just for fun β and it also gives you an easy way to eyeball these values down the road. cute and functional, the duality π
π₯ SEE ALSO π₯
DBIx::Class::Schema::Diff
π 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.
okay bestie that's the whole page π«Ά go forth and diff your schemas. this was the DBIx::Class::Schema::Diff::SchemaData page from User Contributed Perl Documentation, shipped with perl v5.42.0, dated 2025-07-25 β slay, mwah π
πβ¨
π¦ where this page comes from
- fedora 43: perl-DBIx-Class-Schema-Diff 1.13-15.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms