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.

Reading a loadable functiondoctest
$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 $name
public LoadableResult $returns
public Text $library
public bool $aggregate = false
public bool $ifNotExists = false

Methods§

public function __construct(
    public Name $name,
    public LoadableResult $returns,
    public Text $library,
    public bool $aggregate = false,
    public bool $ifNotExists = false,
)

Parameters

$nameNameThe function name
$returnsLoadableResultThe return type
$libraryTextThe file name of the shared library, written as a quoted string
$aggregateboolWhether the function is an aggregate function
$ifNotExistsboolWhether IF NOT EXISTS is written (MySQL 8.0.29 and later)
Calls 1
public function deriveStatement(Derivation $derivation): void

Derives nothing: registering a loadable function is a request.

Parameters

$derivationDerivation
public function render(Output $out): void

Writes the statement.

Parameters

$outOutput
Test cases 1
Calls 3

Test cases 5§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 3
Other tests reaching this symbol 2

Relations§

Instantiated in 1
Type declarations 1