MariaDb1027Platform.php 902 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 25 26
    }

    /**
     * {@inheritdoc}
     */
27
    protected function getReservedKeywordsClass() : string
28 29 30 31 32 33 34
    {
        return Keywords\MariaDb102Keywords::class;
    }

    /**
     * {@inheritdoc}
     */
35
    protected function initializeDoctrineTypeMappings() : void
36 37 38
    {
        parent::initializeDoctrineTypeMappings();

39
        $this->doctrineTypeMapping['json'] = Types::JSON;
40 41
    }
}