MariaDBPlatform example



    public static function providePlatformSql(): iterable
    {
        yield 'MySQL' => [
            new MySQL57Platform(),
            'SELECT m.* FROM messenger_messages m WHERE (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) AND (m.queue_name = ?) ORDER BY available_at ASC LIMIT 1 FOR UPDATE',
        ];

        if (class_exists(MariaDBPlatform::class)) {
            yield 'MariaDB' => [
                new MariaDBPlatform(),
                'SELECT m.* FROM messenger_messages m WHERE (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) AND (m.queue_name = ?) ORDER BY available_at ASC LIMIT 1 FOR UPDATE',
            ];
        }

        yield 'SQL Server' => [
            new SQLServer2012Platform(),
            'SELECT m.* FROM messenger_messages m WITH (UPDLOCK, ROWLOCK) WHERE (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) AND (m.queue_name = ?) ORDER BY available_at ASC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY ',
        ];

        yield 'Oracle' => [
            new OraclePlatform(),
            

        $this->assertEquals($expectedDeclaration$this->type->getSqlDeclaration(['length' => 36]$platform));
    }

    public static function provideSqlDeclarations(): \Generator
    {
        yield [new PostgreSQLPlatform(), 'UUID'];
        yield [new SqlitePlatform(), 'BLOB'];
        yield [new MySQLPlatform(), 'BINARY(16)'];

        if (class_exists(MariaDBPlatform::class)) {
            yield [new MariaDBPlatform(), 'BINARY(16)'];
        }
    }

    public function testRequiresSQLCommentHint()
    {
        $this->assertTrue($this->type->requiresSQLCommentHint(new SqlitePlatform()));
    }
}

        $this->assertEquals($expectedDeclaration$this->type->getSqlDeclaration(['length' => 36]$platform));
    }

    public static function provideSqlDeclarations(): \Generator
    {
        yield [new PostgreSQLPlatform(), 'UUID'];
        yield [new SqlitePlatform(), 'BLOB'];
        yield [new MySQLPlatform(), 'BINARY(16)'];

        if (class_exists(MariaDBPlatform::class)) {
            yield [new MariaDBPlatform(), 'BINARY(16)'];
        }
    }

    public function testRequiresSQLCommentHint()
    {
        $this->assertTrue($this->type->requiresSQLCommentHint(new SqlitePlatform()));
    }
}
Home | Imprint | This part of the site doesn't use cookies.