MariaDb1027Platform.php 825 Bytes
Newer Older
1 2 3 4
<?php

namespace Doctrine\DBAL\Platforms;

5
use Doctrine\DBAL\Types\Types;
6 7 8 9

/**
 * Provides the behavior, features and SQL dialect of the MariaDB 10.2 (10.2.7 GA) database platform.
 *
10
 * Note: Should not be used with versions prior to 10.2.7.
11
 */
12
final class MariaDb1027Platform extends MySqlPlatform
13 14 15
{
    /**
     * {@inheritdoc}
16
     *
17 18
     * @link https://mariadb.com/kb/en/library/json-data-type/
     */
19
    public function getJsonTypeDeclarationSQL(array $field): string
20
    {
21
        return 'LONGTEXT';
22 23
    }

24
    protected function getReservedKeywordsClass(): string
25 26 27 28
    {
        return Keywords\MariaDb102Keywords::class;
    }

29
    protected function initializeDoctrineTypeMappings(): void
30 31 32
    {
        parent::initializeDoctrineTypeMappings();

33
        $this->doctrineTypeMapping['json'] = Types::JSON;
34 35
    }
}