This software enhances DBI by creating user-friendly subroutines to ensure consistent access across all programs in a project.
The module offers several subroutines for fetching data from a database. getrow() gets a single row of data, getrow_arrayref() retrieves a reference to an array containing data from a row, and getrow_hashref() returns a reference to a hash containing column-value pairs. For fetching multiple rows, getall() is a great option as it retrieves an array reference containing rows of data. getall_arrayrefs() also works similarly. Using getall_hashrefs(), developers can get all rows as a reference to an array of hash references.
Activator::DB also provides subroutines for executing queries such as INSERT, DELETE, and UPDATE. The do() function is usually used for these query executions. However, the do_id() method works differently and returns the ID of the newly inserted row.
The module allows developers to easily switch between multiple databases using the connect() function to connect to different databases. When working with multiple databases, it is important to keep track of the current connection. Activator::DB provides a way to reset the connection back to the default using the connect() function.
Transaction management is still under development and not yet implemented, but the module is promising to have many useful functionalities to make working with databases easier and more convenient in the future.
Version 0.91: N/A