Skip to content

Commit

Permalink
Renamed DB_CONNECTION setting from 'mysql' to 'mariadb'
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterZydra committed Apr 17, 2024
1 parent d71b58a commit 6cde69f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ DB_PORT=3306
DB_DATABASE="bioman"
DB_USERNAME="user"
DB_PASSWORD="secret"

# Or SQLite
DB_CONNECTION="sqlite"
DB_FILE="path/bioman.db"
```

-------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion framework/Database/CreateTableBlueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct(
private string $table
){
switch (Config::env('DB_CONNECTION')) {
case 'mysql':
case 'mariadb':
$this->blueprint = new MariaDBCreateTableBlueprint($table);
break;

Expand Down
2 changes: 1 addition & 1 deletion framework/Database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static function getDb(): void
return;
}
switch (Config::env('DB_CONNECTION')) {
case 'mysql':
case 'mariadb':
self::$db = new MariaDB(Config::env('DB_HOST'), intval(Config::env('DB_PORT')), Config::env('DB_DATABASE'), Config::env('DB_USERNAME'), Config::env('DB_PASSWORD'));
break;

Expand Down
2 changes: 1 addition & 1 deletion framework/Database/Migration/MigrationRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private function doesMigrationsTableExists(): bool
// TODO Find a better solution for this
$result = false;
switch (Config::env('DB_CONNECTION')) {
case 'mysql':
case 'mariadb':
$result = Database::prepared(
'SELECT TABLE_NAME FROM information_schema.TABLES ' .
'WHERE TABLE_SCHEMA LIKE ? AND TABLE_TYPE LIKE \'BASE TABLE\' AND TABLE_NAME = \'migrations\'',
Expand Down

0 comments on commit 6cde69f

Please sign in to comment.