Function Database_Static_postgresql->create_table__sql

Definitions

sources/database/postgresql.php

  • Get SQL for creating a new table.
  • 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 table name
$fields array No No required parameter N/A N/A A map of field names to software field types (with *#? encodings)
$connection mixed No No required parameter N/A N/A The DB connection to make on
$raw_table_name ID_TEXT No No required parameter N/A N/A The table name with no table prefix
$save_bytes boolean No No False N/A N/A Whether to use lower-byte table storage, with trade-offs of not being able to support all unicode characters; use this if key length is an issue

Returns

  • List of SQL queries to run
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get SQL for creating a new table.
 *
 * @param  ID_TEXT $table_name The table name
 * @param  array $fields A map of field names to software field types (with *#? encodings)
 * @param  mixed $connection The DB connection to make on
 * @param  ID_TEXT $raw_table_name The table name with no table prefix
 * @param  boolean $save_bytes Whether to use lower-byte table storage, with trade-offs of not being able to support all unicode characters; use this if key length is an issue
 * @return array List of SQL queries to run
 */

public function create_table__sql(string $table_name, array $fields, $connection, string $raw_table_name, bool $save_bytes = false) : array