You are here

public function Connection::hasJson in Drupal 10

File

core/modules/pgsql/src/Driver/Database/pgsql/Connection.php, line 359

Class

Connection
PostgreSQL implementation of \Drupal\Core\Database\Connection.

Namespace

Drupal\pgsql\Driver\Database\pgsql

Code

public function hasJson() : bool {
  try {
    return (bool) $this
      ->query('SELECT JSON_TYPEOF(\'1\')');
  } catch (\Exception $e) {
    return FALSE;
  }
}