CreateTable class

Framework\Database\Definition\CreateTable

Class CreateTable.

Extends Framework\Database\Definition\Table\TableStatement

Implements: Stringable

Defined in libraries/database/src/Definition/CreateTable.php

Constants #

Methods #

definition()
-
ifNotExists()
-
orReplace()
Adds a OR REPLACE part.
run()
Runs the CREATE TABLE statement.
sql()
-
table()
-
temporary()
-
renderDefinition()
-
renderIfNotExists()
-
renderOrReplace()
-
renderTable()
-
renderTemporary()
-

definition()

public function definition(callable $definition): static
Parameters
  • callable $definition
Returns static

ifNotExists()

public function ifNotExists(): static
Returns static

orReplace()

public function orReplace(): static

Adds a OR REPLACE part.

WARNING: This feature is MariaDB only. It is not compatible with MySQL.

Returns static

run()

public function run(): string|int

Runs the CREATE TABLE statement.

Returns string|int - The number of affected rows

sql()

public function sql(): string
Returns string

table()

public function table(string $tableName): static
Parameters
  • string $tableName
Returns static

temporary()

public function temporary(): static
Returns static

renderDefinition()

protected function renderDefinition(): string
Returns string

renderIfNotExists()

protected function renderIfNotExists(): ?string
Returns ?string

renderOrReplace()

protected function renderOrReplace(): ?string
Returns ?string

renderTable()

protected function renderTable(): string
Returns string

renderTemporary()

protected function renderTemporary(): ?string
Returns ?string

Inherited methods #