Table
Less than 1 minute
Table
Methods
listTables
List all tables in the database.
public listTables(): void
tableExists
Check if a table exists in the database.
public tableExists(string $tableName): bool
Parameters
Parameter | Type | Description |
---|---|---|
$tableName | string |
createTable
Create a new table in the database.
public createTable(string $tableName, mixed $columns): bool
Parameters
Parameter | Type | Description |
---|---|---|
$tableName | string | |
$columns | mixed |
describeTable
Describe a table in the database.
public describeTable(string $tableName, ?string $sort, false $): void
Parameters
Parameter | Type | Description |
---|---|---|
$tableName | string | |
$sort | string | |
$ | false |
renameTable
Rename a table in the database.
public renameTable(string $fromName, string $toName): bool
Parameters
Parameter | Type | Description |
---|---|---|
$fromName | string | |
$toName | string |
dropTable
Drop a table from the database.
public dropTable(string $name, bool $ifExists = false, bool $cascade = false): bool
Parameters
Parameter | Type | Description |
---|---|---|
$name | string | |
$ifExists | bool | |
$cascade | bool |
addColumn
Add a column to a table in the database.
public addColumn(string $tableName, mixed $columnSpec): bool
Parameters
Parameter | Type | Description |
---|---|---|
$tableName | string | |
$columnSpec | mixed |
alterColumn
Alter a column in a table in the database.
public alterColumn(string $tableName, string $column, mixed $columnSpec): bool
Parameters
Parameter | Type | Description |
---|---|---|
$tableName | string | |
$column | string | |
$columnSpec | mixed |
dropColumn
Drop a column from a table in the database.
public dropColumn(string $tableName, string $column, bool $ifExists = false): bool
Parameters
Parameter | Type | Description |
---|---|---|
$tableName | string | |
$column | string | |
$ifExists | bool |
truncate
Rename a column in a table in the database.
public truncate(string $tableName, bool $only = false, bool $restartIdentity = false, bool $cascade = false): bool
Parameters
Parameter | Type | Description |
---|---|---|
$tableName | string | |
$only | bool | |
$restartIdentity | bool | |
$cascade | bool |
Generated by Hazaar API Doc Generator