MySQL:...:Table(3pm)

πŸ“¦
version 0.60 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

✨ NAME ✨

MySQL::Diff::Table β€” the Table Definition Class, aka the glow-up your MySQL table definitions deserve πŸ’…

(this lil icon lives in the User Contributed Perl Documentation corner of the manual, iykyk πŸŽ€)


🌸 SYNOPSIS 🌸

  use MySQL::Diff::Table

  my $db = MySQL::Diff::Database->new(%options);
  my $def           = $db->def();
  my $name          = $db->name();
  my $field         = $db->field();
  my $fields        = $db->fields();                # %$fields
  my $primary_key   = $db->primary_key();
  my $indices       = $db->indices();               # %$indices
  my $options       = $db->options();

  my $isfield       = $db->isa_field($field);
  my $isprimary     = $db->isa_primary($field);
  my $isindex       = $db->isa_index($field);
  my $isunique      = $db->is_unique($field);
  my $isfulltext    = $db->is_fulltext($field);

like yes bestie, that's literally the whole vibe check right there πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

okay so. this module parses a table definition into component parts. that's it, that's the whole job. it takes your big messy table definition and breaks it down into little bite-sized pieces so you can actually look at them. it's giving organizational queen energy πŸ‘‘


πŸ”₯ METHODS πŸ”₯

🧚 Constructor

  • new( %options ) β€” instantiate the objects, bestie. you hand it the command line options it needs for database access and for the process requirements, and it makes you a fresh object. slay. ✨

πŸ‘‘ Public Methods

so like, the fuller documentation will appear here in time :) (yes really, that's what it says, the author said it first not me πŸ™ˆ). but for now, here's the roster:

  • def β€” returns the table definition as a string. the whole thing, one string, iconic πŸ’–
  • name β€” returns the name of the current table. name check bestie πŸͺͺ
  • field β€” returns the current field definition of the given field.
  • fields β€” returns an array reference to a list of fields.
  • primary_key β€” returns a hash reference to fields used as primary key fields. the main characters πŸ”‘
  • indices β€” returns a hash reference to fields used as index fields.
  • options β€” returns the additional options added to the table definition.
  • isa_field β€” returns 1 if the given field is used in the current table definition, otherwise returns 0.
  • isa_primary β€” returns 1 if the given field is defined as a primary key, otherwise returns 0.
  • isa_index β€” returns 1 if the given field is used as an index field, otherwise returns 0.
  • is_unique β€” returns 1 if the given field is used as a unique index field, otherwise returns 0.
  • is_fulltext β€” returns 1 if the given field is used as a fulltext index field, otherwise returns 0.
  • is_auto_inc β€” returns 1 if the given field is defined as an auto increment field, otherwise returns 0. the field that just keeps going up, no cap, literally πŸ“ˆ
ngl the 1-or-0 thing is the entire personality of the is* methods. true or false, yes or no, it ate and left no crumbs πŸ“

Copyright (c) 2000-2016 Adam Spiers. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

(yes, "same terms as Perl itself" β€” that's the whole license vibe, go read Perl's if you need the deets 🫢)


🌈 SEE ALSO 🌈

  • mysqldiff
  • MySQL::Diff
  • MySQL::Diff::Database
  • MySQL::Diff::Utils

go read those too, bestie, the whole squad is here πŸ’œ


πŸ¦‹ AUTHOR πŸ¦‹

Adam Spiers <mysqldiff@adamspiers.org>


and that's a wrap on MySQL:...:Table(3pm), from User Contributed Perl Documentation β€” this version was churned out by perl v5.26.2 back on 2018-07-20, so yeah it's a lil vintage but it still ate πŸ’…βœ¨ periodt

πŸ“¦ where this page comes from