MariaDb1027Platform.php 900 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
<?php

namespace Doctrine\DBAL\Platforms;

use Doctrine\DBAL\Types\Type;

/**
 * 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 39 40 41
    {
        parent::initializeDoctrineTypeMappings();

        $this->doctrineTypeMapping['json'] = Type::JSON;
    }
}