classCreateTablespace
final class CreateTablespace
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.A request to create a tablespace.
Rule: PG-TABLESPACE-001. Mirrors CreateTableSpaceStmt: name, owner, location and the tablespace parameters of WITH ( ... ). Source: https://www.postgresql.org/docs/17/sql-createtablespace.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("CREATE TABLESPACE fast OWNER app LOCATION '/ssd' WITH (random_page_cost = 1)");
[$operation->statement->location->value, $operation->statement->options[0]->name->value] // => ['/ssd', 'random_page_cost']Properties§
public list<Definition> $optionspublic Name $namepublic RoleSpec|null $ownerpublic StringConstant $locationMethods§
public function __construct(
public Name $name,
public RoleSpec|null $owner,
public StringConstant $location,
list<Definition> $options = [],
)Parameters
$name | Name | The tablespace name |
$owner | RoleSpec|null | The owner, when OWNER is written |
$location | StringConstant | The directory |
$options | list<Definition> | The tablespace parameters |
Calls 2
- static-call Check::listOf() line 48
- class-const Definition::class() line 48
public function deriveStatement(Derivation $derivation): voidDerives the parameter values.
Parameters
$derivation | Derivation |
Calls 2
- method-call ClauseFacts::derive() line 56
- new ClauseFacts line 56
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 64
- class-const NameUse::Column() line 64
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
CreateTablespaceTestcalls