Function Database_super_mysql->create_index__sql
Definitions
sources/database/shared/mysql.php
- Get SQL for creating a table index.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
---|---|---|---|---|---|---|---|
$table_name | ID_TEXT | No | No | required parameter | N/A | N/A | The name of the table to create the index on |
$index_name | ID_TEXT | No | No | required parameter | N/A | N/A | The index name (not really important at all) |
$_fields | string | No | No | required parameter | N/A | N/A | Part of the SQL query: a comma-separated list of fields to use on the index |
$connection_read | mixed | No | No | required parameter | N/A | N/A | The DB connection, may be used for running checks |
$raw_table_name | ID_TEXT | No | No | required parameter | N/A | N/A | The table name with no table prefix |
$unique_key_fields | string | No | No | required parameter | N/A | N/A | The name of the unique key field for the table |
$table_prefix | string | No | No | required parameter | N/A | N/A | The table prefix |
Returns
- List of SQL queries to run
- Type: array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Get SQL for creating a table index.
*
* @param ID_TEXT $table_name The name of the table to create the index on
* @param ID_TEXT $index_name The index name (not really important at all)
* @param string $_fields Part of the SQL query: a comma-separated list of fields to use on the index
* @param mixed $connection_read The DB connection, may be used for running checks
* @param ID_TEXT $raw_table_name The table name with no table prefix
* @param string $unique_key_fields The name of the unique key field for the table
* @param string $table_prefix The table prefix
* @return array List of SQL queries to run
*/
public function create_index__sql(string $table_name, string $index_name, string $_fields, $connection_read, string $raw_table_name, string $unique_key_fields, string $table_prefix) : array
* Get SQL for creating a table index.
*
* @param ID_TEXT $table_name The name of the table to create the index on
* @param ID_TEXT $index_name The index name (not really important at all)
* @param string $_fields Part of the SQL query: a comma-separated list of fields to use on the index
* @param mixed $connection_read The DB connection, may be used for running checks
* @param ID_TEXT $raw_table_name The table name with no table prefix
* @param string $unique_key_fields The name of the unique key field for the table
* @param string $table_prefix The table prefix
* @return array List of SQL queries to run
*/
public function create_index__sql(string $table_name, string $index_name, string $_fields, $connection_read, string $raw_table_name, string $unique_key_fields, string $table_prefix) : array