classCreateLoadableFunction
final class CreateLoadableFunction
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.CREATE [AGGREGATE] FUNCTION ... SONAME: registers a loadable function of a shared library.
Rule: MYSQL-LOADABLE-FUNCTION-001. The statement is structured as a request only: it changes no context and derives nothing. A loadable function has no database and no definer. Source: https://dev.mysql.com/doc/refman/8.4/en/create-function-loadable.html. Status: Implemented.
$create = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("CREATE AGGREGATE FUNCTION median RETURNS REAL SONAME 'udf.so'");
[$create->statement->aggregate, $create->statement->returns->value, $create->statement->library->value] // => [true, 'REAL', 'udf.so']Properties§
public Name $namepublic LoadableResult $returnspublic Text $librarypublic bool $aggregate = falsepublic bool $ifNotExists = falseMethods§
public function __construct(
public Name $name,
public LoadableResult $returns,
public Text $library,
public bool $aggregate = false,
public bool $ifNotExists = false,
)Parameters
$name | Name | The function name |
$returns | LoadableResult | The return type |
$library | Text | The file name of the shared library, written as a quoted string |
$aggregate | bool | Whether the function is an aggregate function |
$ifNotExists | bool | Whether IF NOT EXISTS is written (MySQL 8.0.29 and later) |
Calls 1
- static-call Check::input() line 48
public function deriveStatement(Derivation $derivation): voidDerives nothing: registering a loadable function is a request.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Test cases 1
Calls 3
- method-call Output::keyword() line 63
- method-call Output::name() line 71
- class-const NameUse::Routine() line 71
Test cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.