Alzabo...eignKey(3pm)
π Alzabo::Runtime::ForeignKey β the Alzabo...eignKey(3pm) page, bestie edition β¨
okay so. you opened the manual for Alzabo...eignKey(3pm) and honestly? you came to the right place. this is the whole thing, nothing skipped, everything kept. let's go π«Ά
β¨ NAME β¨
Alzabo::Runtime::ForeignKey β it's giving foreign key objects. that's the whole vibe. π
π SYNOPSIS π
look at her. three lines. iconic.
$fk->register_insert( $value_for_column );
$fk->register_update( $new_value_for_column );
$fk->register_delete( $row_being_deleted );
πΈ DESCRIPTION πΈ
so objects in this class maintain referential integrity. that's their whole job. their moment. their era.
and like β be honest β this is really only useful when your RDBMS can't do this itself. the example given is MySQL without InnoDB. no cap, if your database already handles this, this class is basically standing there holding your emotional support water bottle. π
π¦ INHERITS FROM π¦
Alzabo::ForeignKey
π quick note, bestie: all relevant documentation from the superclass has been merged into this document. so don't go chasing it elsewhere, it's all right here. you're welcome. β¨
π METHODS π
table_from
table_to
Returns the relevant Alzabo::Runtime::Table object. that's it. that's the method. slay. π
columns_from
columns_to
Returns the relevant Alzabo::Runtime::Column object(s) for the property, and it hands them back as an array. plural behavior, plural energy. π
cardinality
Returns a two element array containing the two portions of the cardinality of the relationship. and each portion? either '1' or 'n'. those are literally the only two options. pick your fighter. β
from_is_dependent
to_is_dependent
Returns a boolean value telling you whether there's a dependency from one table to the other. yes or no, king. π
is_one_to_one
is_one_to_many
is_many_to_one
Returns a boolean value indicating what kind of relationship the object represents. it's giving situationship taxonomy but make it relational databases. π
is_same_relationship_as ($fk)
you hand it a foreign key object, and it returns true if the two objects represent the same relationship.
but β and this is the cute plot twist β the two objects may represent the same relationship from different table's points of view. so it's the same love story, just told by two different narrators. π
register_insert ($new_value)
This method takes the proposed column value for a new row and makes sure it's valid based on the relationship that this object represents. vibe check on the way in. β
Throws: Alzabo::Exception::ReferentialIntegrity
register_update ($new_value)
This method takes the proposed new value for a column and makes sure it's valid based on the relationship that this object represents. same energy, different lifecycle event. π
Throws: Alzabo::Exception::ReferentialIntegrity
register_delete ("Alzabo::Runtime::Row" object)
Allows the foreign key to delete rows dependent on the row being deleted.
π WARNING, FR FR: note that this can lead to a chain reaction of cascading deletions. you have been warned. this is not a drill. one delete becomes twelve deletes. the dominoes are dominoing. π
Throws: Alzabo::Exception::ReferentialIntegrity
id
Returns a string uniquely identifying the foreign key. her little name tag. π·οΈβ¨
comment
Returns the comment associated with the foreign key object, if any. might be there, might not, no pressure. π
π§ AUTHOR π§
Dave Rolsky, <autarch@urth.org> β shoutout to the icon, the legend, the moment. π
and that's the page!! every option, every method, every throw, every warning, all intact, nothing dropped, we ate and left no crumbs. π
this was perl v5.34.0, dated 2022-06-14, and it lives at Alzabo...eignKey(3pm) β mwah, take care of her, she's doing her best. π
πβ¨
π¦ where this page comes from
- debian bookworm: libalzabo-perl 0.92-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libalzabo-perl 0.92-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libalzabo-perl 0.92-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libalzabo-perl 0.92-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libalzabo-perl 0.92-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms