NAME
whatbot::Connection::Table - Class wrapper for a database table
SYNOPSIS
my $table = new whatbot::Connection::Table; $table->init_table({}); $table->create({});
DESCRIPTION
whatbot::Connection::Table wraps a database table into a simple class to add and return data from. To generate a class for a given table, pass 'init_table' to a new Table object with the table name and column definitions. If the table doesn't exist in the database, it will be auto created for you. Once the object is live, 'create' and 'search' methods are available to add and retrieve rows (whatbot::Connection::Table::Row) from the database. To delete or update data, perform those actions directly on the returned rows.
METHODS
- init_table( \%table_params )
- Create a new table definition.
- create( \%column_data )
- Create a new row in this table. The passed hashref should contain the column names as keys, with the desired data in values. Any column not listed in the hashref will be filled by the corresponding entry in init_table's 'defaults' if available, or will be left to the database to decide. Returns a whatbot::Connection::Table::Row object if successful, undef on failure.
- delete()
- Delete this record from the database.
INHERITANCE
LICENSE/COPYRIGHT
Be excellent to each other and party on, dudes.