SQL::S...nction(3pm)

๐Ÿ“ฆ
version 1.414 ยท 6 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

๐ŸŒธ SQL::Statement::Function(3pm) ๐Ÿ’…

okay so bestie ๐Ÿ’– welcome to the manual page for SQL::Statement::Function(3pm), coming at you live from the User Contributed Perl Documentation. and ngl, this page is not one module โ€” it's a whole friend group ๐Ÿ‘‘: one abstract base class plus five little function-executing terms that inherit from it. let's meet them one by one, no skipping, i promise. โœจ


๐ŸŽ€ SQL::Statement::Function

NAME ๐Ÿ’–

SQL::Statement::Function โ€” the abstract base class for all function executing terms. she's the blueprint, not the building, and honestly? queen behavior.

SYNOPSIS ๐ŸŒธ

  # this class does not have a common constructor, because all derived classes
  # have their special requirements

DESCRIPTION โœจ

SQL::Statement::Function is an abstract base class, and what she does is provide the interface for all function executing terms. literally the template everybody else copies off of. no cap.

INHERITANCE ๐Ÿ‘‘

SQL::Statement::Function
ISA SQL::Statement::Term

METHODS ๐Ÿ’…

DESTROY

Destroys the term, and while she's at it she undefines the weak reference to the owner and the reference to the parameter list. clean exit, tidy girl, iconic.


๐Ÿฆ‹ SQL::Statement::Function::UserFunc

NAME ๐Ÿ’–

SQL::Statement::Function::UserFunc โ€” this one implements executing a perl subroutine. yes, we're calling your own subs now, slay.

SYNOPSIS ๐ŸŒธ

  # create an user function term with an SQL::Statement object as owner,
  # specifying the function name, the subroutine name (full qualified)
  # and the parameters to the subroutine
  my $term = SQL::Statement::Function::UserFunc->new( $owner, $name, $sub, \@params );
  # access the result of that operation
  $term->value( $eval );

DESCRIPTION โœจ

SQL::Statement::Function::UserFunc implements a term which returns the result of the specified subroutine. she's the middleman and she's thriving.

INHERITANCE ๐Ÿ‘‘

SQL::Statement::Function
ISA SQL::Statement::Term

METHODS ๐Ÿ’…

new

Instantiates a new "SQL::Statement::Function::UserFunc" instance. fresh out the box ๐ŸŽ€.

value

Invokes the given subroutine with the values of the params and returns its result โ€” the vibe is exactly this:

    my @params = map { $_->value($eval); } @{ $self->{PARAMS} };
    return $subpkg->$subname( $self->{OWNER}, @params );

๐ŸŒˆ SQL::Statement::Function::NumericEval

NAME ๐Ÿ’–

SQL::Statement::Function::NumericEval โ€” implements numeric evaluation of a term. math girlies rise ๐Ÿงฎโœจ.

SYNOPSIS ๐ŸŒธ

  # create an user function term with an SQL::Statement object as owner,
  # specifying the expression to evaluate and the parameters to the subroutine
  my $term = SQL::Statement::Function::NumericEval->new( $owner, $expr, \@params );
  # access the result of that operation
  $term->value( $eval );

DESCRIPTION โœจ

SQL::Statement::Function::NumericEval implements the numeric evaluation of a term. heads up bestie: all parameters are expected to be numeric. don't bring strings to a numbers party.

INHERITANCE ๐Ÿ‘‘

SQL::Statement::Function::NumericEval
ISA SQL::Statement::Function
  ISA SQL::Statement::Term

METHODS ๐Ÿ’…

new

Instantiates a new "SQL::Statement::Function::NumericEval" instance. Takes $owner, $expr and \@params as arguments, in exactly that order โ€” order matters, periodt.

value

Returns the result of the evaluated expression. that's it, that's the whole job ๐Ÿ’–.


๐ŸŽ€ SQL::Statement::Function::Trim

NAME ๐Ÿ’–

SQL::Statement::Function::Trim โ€” implements the built-in trim function support. she trims. it's giving haircut but for strings โœ‚๏ธ.

SYNOPSIS ๐ŸŒธ

  # create an trim function term with an SQL::Statement object as owner,
  # specifying the spec, char and the parameters to the subroutine
  my $term = SQL::Statement::Function::Trim->new( $owner, $spec, $char, \@params );
  # access the result of that operation
  $term->value( $eval );

DESCRIPTION โœจ

SQL::Statement::Function::Trim implements string trimming. so clean, so fresh ๐Ÿงผ.

INHERITANCE ๐Ÿ‘‘

SQL::Statement::Function::Trim
ISA SQL::Statement::Function
  ISA SQL::Statement::Term

METHODS ๐Ÿ’…

new

Instantiates a new "SQL::Statement::Function::Trim" instance. Takes $owner, $spec, $char and \@params as arguments, in that exact specified order.

and now, the meaning of the parameters ๐Ÿซถ:

  • $spec โ€” can be one of 'LEADING', 'TRAILING', 'BOTH'. Trims the leading chars, the trailing chars, or both ends, respectively. Defaults to 'BOTH'.
  • $char โ€” the character to trim. defaults to ' '.
  • \@params โ€” expected to be an array with exact 1 element (any more than that are not evaluated, so don't bother adding extras bestie).

value

Returns the trimmed value of the first parameter argument. ๐Ÿ’…


๐Ÿงš SQL::Statement::Function::SubString

NAME ๐Ÿ’–

SQL::Statement::Function::SubString โ€” implements the built-in sub-string function support. slicing strings like a boss ๐Ÿ”ฅ.

SYNOPSIS ๐ŸŒธ

  # create an substr function term with an SQL::Statement object as owner,
  # specifying the start and length of the sub string to extract from the
  # first element of \@params
  my $term = SQL::Statement::SubString->new( $owner, $start, $length, \@params );
  # access the result of that operation
  $term->value( $eval );

DESCRIPTION โœจ

SQL::Statement::Function::SubString implements a sub-string extraction term. give her a string, she gives you a piece of it. generous.

INHERITANCE ๐Ÿ‘‘

SQL::Statement::Function::SubString
ISA SQL::Statement::Function
  ISA SQL::Statement::Term

METHODS ๐Ÿ’…

new

Instantiates a new "SQL::Statement::Function::SubString" instance. Takes $owner, $start, $length and \@params as arguments, in the specified order โ€” yes, order, always order.

meaning of the parameters, let's break it down ๐ŸŒธ:

  • $start โ€” specifies the start position to extract the sub-string. this is expected to be a SQL::Statement::Term instance. and the important detail: the first character in a string has the position 1. (not zero, bestie, do not come in here with your zero-indexed nonsense ๐Ÿ™ˆ)
  • $length โ€” specifies the length of the extracted sub-string. this is expected to be a SQL::Statement::Term instance. if omitted, everything to the end of the string is returned. so generous, so effortless โœจ
  • \@params โ€” expected to be an array with exact 1 element (more are not evaluated).

value

Returns the extracted sub-string value from the first parameter argument. periodt. ๐Ÿ’…


๐Ÿ’œ SQL::Statement::Function::StrConcat

NAME ๐Ÿ’–

SQL::Statement::Function::StrConcat โ€” implements the built-in string concatenation. she's the glue holding your strings together, literally ๐Ÿซถ.

SYNOPSIS ๐ŸŒธ

  # create an substr function term with an SQL::Statement object as owner
  # and \@params to concatenate
  my $term = SQL::Statement::StrConcat->new( $owner, \@params );
  # access the result of that operation
  $term->value( $eval );

DESCRIPTION โœจ

SQL::Statement::Function::StrConcat implements a string concatenation term. smash those strings together, main character energy ๐Ÿ‘‘.

INHERITANCE ๐Ÿ‘‘

SQL::Statement::Function::StrConcat
ISA SQL::Statement::Function
  ISA SQL::Statement::Term

METHODS ๐Ÿ’…

new

Instantiates a new "SQL::Statement::Function::StrConcat" instance. that's the whole description, she's lowkey simple like that.

value

Returns the concatenated string composed of the parameter values. all of them, joined, one happy little family ๐Ÿ’–.


Copyright (c) 2009-2020 by Jens Rehsack: rehsackATcpan.org

All rights reserved.

You may distribute this module under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.


and that's the whole page bestie ๐ŸŽ€ ty for reading to the end, you ate. this was SQL::S...nction(3pm) from perl v5.30.3, dated 2020-10-23, in the User Contributed Perl Documentation ๐Ÿ’…โœจ no cap, see you in the next man page. ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from