$pdo
$pdo : \Pdo
Pdo instance.
Abstract database adapter class.
The AbstractDatabaseAdapter
is designed to provide a basic abstraction for database
connection and management. This class is declared as abstract and offers a basic implementation
of several methods defined in the DatabaseAdapterInterface
interface.
__construct(string $dsn, string $username = '', string $password = '') : mixed
Constructs a new database adapter instance.
string | $dsn | The Data Source Name (DSN) for the database connection. |
string | $username | The username for the database connection. |
string | $password | The password for the database connection. |
if the PDO extension is not installed or enabled.
if the database connection fails.
checkIfDatabaseExists(string $host, string $port, string $username, string $password) : void
Check if database exists, otherwise create it.
string | $host | Holds the host of the database. |
string | $port | Holds the port number. |
string | $username | Holds the username for the connection. |
string | $password | Holds the password for the connection. |
createTable(string $table) : \Omega\Database\Migration\AbstractMigration
Start a new migration to create a table on this connection.
string | $table | The name of the table to create. |
Returns an instance of the AbstractMigration class for managing table creation.
alterTable(string $table) : \Omega\Database\Migration\AbstractMigration
Start a new migration to modify an existing table on this connection.
string | $table | The name of the table to modify. |
Returns an instance of the AbstractMigration class for managing table alterations.