Table
About 1 min
Table
interface TableMethods
listTables
List all tables in the database.
public listTables(): arrayReturns: array
tableExists
Check if a table exists in the database.
public tableExists(string $tableName): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$tableName | string |
createTable
Create a new table in the database.
public createTable(string $tableName, array $columns): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$tableName | string | |
$columns | array |
describeTable
Describe a table in the database.
public describeTable(string $tableName, ?string $sort): array|falseReturns: array|false
Parameters
| Parameter | Type | Description |
|---|---|---|
$tableName | string | |
$sort | string |
renameTable
Rename a table in the database.
public renameTable(string $fromName, string $toName): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$fromName | string | |
$toName | string |
dropTable
Drop a table from the database.
public dropTable(string $name, bool $ifExists, bool $cascade): boolReturns: 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, array $columnSpec): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$tableName | string | |
$columnSpec | array |
alterColumn
Alter a column in a table in the database.
public alterColumn(string $tableName, string $column, array $columnSpec): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$tableName | string | |
$column | string | |
$columnSpec | array |
dropColumn
Drop a column from a table in the database.
public dropColumn(string $tableName, string $column, bool $ifExists): boolReturns: 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, bool $restartIdentity, bool $cascade): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$tableName | string | |
$only | bool | |
$restartIdentity | bool | |
$cascade | bool |
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:16 +0000