final class CreateSpatialReference
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

CREATE [OR REPLACE] SPATIAL REFERENCE SYSTEM [IF NOT EXISTS] srid attribute …: a request to define a spatial reference system (MySQL 8.0 and later).

Mirrors PT_create_srs (Sql_cmd_create_srs). Rule: MYSQL-CREATE-SRS-001. The attributes are kept in written order. The problems the server reports while it parses the statement are diagnostics (MYSQL-SRS-CHECK-001). A spatial reference system is no relation, so the statement declares none. Source: https://dev.mysql.com/doc/refman/8.4/en/create-spatial-reference-system.html. Status: Implemented.

Defining a spatial reference systemdoctest
$create = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("create or replace spatial reference system 4120 name 'Greek' organization 'EPSG' identified by 4120 definition 'GEOGCS[]'");
    [$create->toString(), $create->facts->diagnostics] // => ["CREATE OR REPLACE SPATIAL REFERENCE SYSTEM 4120 NAME 'Greek' ORGANIZATION 'EPSG' IDENTIFIED BY 4120 DEFINITION 'GEOGCS[]'", []]

Properties§

public list<SpatialAttribute> $attributes
public bool $orReplace
public bool $ifNotExists
public Numeral $srid

Methods§

public function __construct(
    public bool $orReplace,
    public bool $ifNotExists,
    public Numeral $srid,
    list<SpatialAttribute> $attributes,
)

Parameters

$orReplaceboolWhether OR REPLACE is written
$ifNotExistsboolWhether IF NOT EXISTS is written
$sridNumeralThe spatial reference system identifier
$attributeslist<SpatialAttribute>The attributes in written order

Throws

InvalidConstruction When OR REPLACE and IF NOT EXISTS are both written
Calls 3
public function deriveStatement(Derivation $derivation): void

Reports the problems the server finds while it parses the statement.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 2

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 2