Schema
- Full name:
\Qubus\Expressive\Schema
Properties
connection
tableList
currentDatabase
columns
Methods
__construct
Constructor.
Parameters:
Parameter | Type | Description |
---|---|---|
$connection | \Qubus\Expressive\Connection | Connection. |
getCurrentDatabase
Get the name of the currently used database.
Throws:
hasTable
Check if the specified table exists.
Parameters:
Parameter | Type | Description |
---|---|---|
$table | string | Table name. |
$clear | bool | (optional) Refresh table list. |
Throws:
getTables
Get a list with all tables that belong to the currently used database.
Parameters:
Parameter | Type | Description |
---|---|---|
$clear | bool | (optional) Refresh table list. |
Throws:
getColumns
Get a list with all columns that belong to the specified table.
Parameters:
Parameter | Type | Description |
---|---|---|
$table | string | |
$clear | bool | (optional) Refresh column list. |
$names | bool | (optional) Return only the column names. |
Throws:
create
Creates a new table.
Parameters:
Parameter | Type | Description |
---|---|---|
$table | string | Table name. |
$callback | callable | A callback that will define table's fields and indexes. |
Throws:
alter
Alters a table's definition.
Parameters:
Parameter | Type | Description |
---|---|---|
$table | string | Table name |
$callback | callable | A callback that will add or remove fields or indexes. |
Throws:
renameTable
Change a table's name.
Parameters:
Parameter | Type | Description |
---|---|---|
$table | string | The table. |
$name | string | The new name of the table. |
Throws:
drop
Deletes a table.
Parameters:
Parameter | Type | Description |
---|---|---|
$table | string | Table name. |
Throws:
truncate
Deletes all records from a table.
Parameters:
Parameter | Type | Description |
---|---|---|
$table | string | Table name. |
Throws:
Automatically generated on 2025-10-13