pdo()
pdo() : \PDO
Get the underlying PDO instance for this connection.
Returns
\PDO —Returns the current PDO instance that represents the database connection.
Database Adapter Interface.
The DatabaseAdapterInterface
defines the contract for database
adapter classes, which provide a set of methods for interacting
with a database.
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. |
query() : \Omega\Database\QueryBuilder\AbstractQueryBuilder
Start a new query builder on this connection.
This method initializes a new query builder instance for building SQL queries.
An instance of the AbstractQueryBuilder class for constructing SQL queries.
createTable(string $table) : \Omega\Database\Migration\AbstractMigration
Start a new migration to create a table on this connection.
This method begins a new migration process for creating a database table.
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.
This method initiates a new migration process for modifying an existing database table.
string | $table | The name of the table to modify. |
Returns an instance of the AbstractMigration class for managing table alterations.
dropTables() : int|bool
Drop all tables in the current database. Use with caution.
This method is used to delete all tables in the current database. Exercise caution as data loss is irreversible.
Returns 1 if all tables are successfully dropped, or false if any issues occur during the process.