Skip to content
Snippets Groups Projects

Postgres - Support GIN and GIST

Open Brad Jones requested to merge issue/drupal-3397622:3397622-adding-gin-and into 11.x
Compare and
6 files
+ 327
11
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 40
0
 
<?php
 
 
declare(strict_types=1);
 
 
namespace Drupal\Core\Database\Schema;
 
 
/**
 
* Class for Schema API index specifications containing db-specific config.
 
*/
 
final class Index extends \ArrayObject {
 
 
/**
 
* Constructor.
 
*
 
* @param array $fields
 
* Array of field specifications for the index.
 
* @param array $config
 
* Array of db-specific config, keyed by database type. Acceptable
 
* keys/values for the configuration are determined by the database driver.
 
*
 
* @see \Drupal\Core\Database\Connection::databaseType()
 
*/
 
public function __construct(array $fields, protected array $config) {
 
parent::__construct($fields);
 
}
 
 
/**
 
* Getter for db-specific configuration.
 
*
 
* @param string $database_type
 
* Database type.
 
*
 
* @return array
 
* Configuration; if not set, will return an empty array.
 
*/
 
public function getDatabaseConfig(string $database_type): array {
 
return $this->config[$database_type] ?? [];
 
}
 
 
}
Loading