DBIx::C...hemaData(3)

πŸ“¦
version 1.13 Β· 2 versions
, in fedora 43

πŸ’– 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 says SchemaDiff while literally everything else on this page is about SchemaData πŸ’€ 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 build data.
  • data β€” you can supply this instead of schema if 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:

  • isa
  • constraints
  • relationships
  • columns
  • private_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>


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