• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ICanBoogie / ActiveRecord / 6362433236

30 Sep 2023 11:14AM UTC coverage: 85.731% (+5.6%) from 80.178%
6362433236

push

github

olvlvl
Rename StaticModelProvider methods

1436 of 1675 relevant lines covered (85.73%)

29.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

28.57
/lib/ActiveRecord/Driver/MySQLDriver.php
1
<?php
2

3
/*
4
 * This file is part of the ICanBoogie package.
5
 *
6
 * (c) Olivier Laviale <olivier.laviale@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
namespace ICanBoogie\ActiveRecord\Driver;
13

14
use ICanBoogie\ActiveRecord\Schema;
15

16
use function implode;
17

18
/**
19
 * Connection driver for MySQL.
20
 */
21
final class MySQLDriver extends BasicDriver
22
{
23
    /**
24
     * @inheritDoc
25
     */
26
    protected function render_create_table(string $table_name, Schema $schema): string
27
    {
28
        return (new TableRendererForMySQL())
1✔
29
            ->render($schema, $table_name);
1✔
30
    }
31

32
    /**
33
     * @inheritdoc
34
     */
35
    public function table_exists(string $name): bool
36
    {
37
        $tables = $this->connection->query('SHOW TABLES')->all(\PDO::FETCH_COLUMN);
×
38

39
        return \in_array($name, $tables);
×
40
    }
41

42
    /**
43
     * @inheritdoc
44
     */
45
    public function optimize(): void
46
    {
47
        $connection = $this->connection;
×
48
        $tables = $connection->query('SHOW TABLES')->all(\PDO::FETCH_COLUMN);
×
49
        $connection->exec('OPTIMIZE TABLE ' . implode(', ', $tables));
×
50
    }
51
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc