SQL::Tr...ocedure(3)

πŸŽ€ NAME πŸŽ€

Okay bestie, this SQL::Tr...ocedure(3) page from User Contributed Perl Documentation is all about SQL::Translator::Schema::Procedure β€” literally a class for dealing with stored procedures (and possibly other pieces of nameable SQL code?). iykyk ✨


🌸 SYNOPSIS 🌸

use SQL::Translator::Schema::Procedure;
my $procedure  = SQL::Translator::Schema::Procedure->new(
    name       => 'foo',
    sql        => 'CREATE PROC foo AS SELECT * FROM bar',
    parameters => 'foo,bar',
    owner      => 'nomar',
    comments   => 'blah blah blah',
    schema     => $schema,
);

✨ DESCRIPTION ✨

SQL::Translator::Schema::Procedure is the class for dealing with stored procedures β€” and possibly other pieces of nameable SQL code? (the question mark is part of the original vibe, we’re keeping it 🫢)


πŸ’… METHODS πŸ’…

🧚 new

Object constructor. It makes the object, bestie.

my $schema = SQL::Translator::Schema::Procedure->new;

πŸ“ parameters

Gets and sets the parameters of the stored procedure. Look at all these valid call styles β€” versatile queen πŸ’…

$procedure->parameters('id');
$procedure->parameters('id', 'name');
$procedure->parameters( 'id, name' );
$procedure->parameters( [ 'id', 'name' ] );
$procedure->parameters( qw[ id name ] );

my @parameters = $procedure->parameters;

πŸ¦‹ name

Get or set the procedure’s name. Simple, iconic.

$procedure->name('foo');
my $name = $procedure->name;

⭐ sql

Get or set the procedure’s SQL. This is where the actual SQL lives.

$procedure->sql('select * from foo');
my $sql = $procedure->sql;

🌈 order

Get or set the order of the procedure.

$procedure->order( 3 );
my $order = $procedure->order;

πŸ‘‘ owner

Get or set the owner of the procedure.

$procedure->owner('nomar');
my $sql = $procedure->owner;

πŸ’œ comments

Get or set the comments on a procedure. Yes, plural comments. Yes, join them.

$procedure->comments('foo');
$procedure->comments('bar');
print join( ', ', $procedure->comments ); # prints "foo, bar"

🧚 schema

Get or set the procedure’s schema object.

$procedure->schema( $schema );
my $schema = $procedure->schema;

πŸ”₯ equals

Determines if this procedure is the same as another. The vibe check, but for procedures.

my $isIdentical = $procedure1->equals( $procedure2 );

🌟 AUTHORS 🌟

Shoutout to Ken Youens-Clark <kclark@cshl.org> and Paul Harrington <Paul-Harrington@deshaw.com>. absolute legends πŸ’–


okay that’s the whole page bestie β€” footer info says perl v5.42.0, dated 2024-12-12. slay and goodbye πŸ’…βœ¨

πŸ“¦ where this page comes from