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

ICanBoogie / ActiveRecord / 11645353913

02 Nov 2024 07:44PM UTC coverage: 86.318%. Remained the same
11645353913

push

github

olvlvl
Tidy Query

9 of 18 new or added lines in 2 files covered. (50.0%)

98 existing lines in 6 files now uncovered.

1369 of 1586 relevant lines covered (86.32%)

24.43 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
namespace ICanBoogie\ActiveRecord\Driver;
4

5
use ICanBoogie\ActiveRecord\Schema;
6

7
use function implode;
8

9
/**
10
 * Connection driver for MySQL.
11
 */
12
final class MySQLDriver extends BasicDriver
13
{
14
    /**
15
     * @inheritDoc
16
     */
17
    protected function render_create_table(string $table_name, Schema $schema): string
18
    {
19
        return (new TableRendererForMySQL())
1✔
20
            ->render($schema, $table_name);
1✔
21
    }
22

23
    /**
24
     * @inheritdoc
25
     */
26
    public function table_exists(string $table_name): bool
27
    {
UNCOV
28
        $tables = $this->connection->query('SHOW TABLES')->all(\PDO::FETCH_COLUMN);
×
29

UNCOV
30
        return \in_array($table_name, $tables);
×
31
    }
32

33
    /**
34
     * @inheritdoc
35
     */
36
    public function optimize(): void
37
    {
UNCOV
38
        $connection = $this->connection;
×
39
        $tables = $connection->query('SHOW TABLES')->all(\PDO::FETCH_COLUMN);
×
UNCOV
40
        $connection->exec('OPTIMIZE TABLE ' . implode(', ', $tables));
×
41
    }
42
}
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

© 2025 Coveralls, Inc