From 52cbb3bde5813292d3ecc62db9898a38166ead87 Mon Sep 17 00:00:00 2001 From: Solomon Ochepa Date: Tue, 1 Apr 2025 04:00:46 +0100 Subject: [PATCH] Check if the database exists. Allows developers to check if a database exists. #296 #814 #1153 #598 --- src/DatabaseConfig.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/DatabaseConfig.php b/src/DatabaseConfig.php index c8280632..dacf9007 100644 --- a/src/DatabaseConfig.php +++ b/src/DatabaseConfig.php @@ -163,4 +163,14 @@ class DatabaseConfig return $databaseManager; } + + /** + * Check if the database exists. + * + * @return bool Returns true if the database exists, otherwise false. + */ + public function exists(): bool + { + return $this->manager()->databaseExists($this->getName()); + } }