DBIx::Table::TestDataGenerator::Query - query database and handle SQL commands
The class provides methods querying the target database for data and the ones handling SQL commands (indirectly via DBIx::Class modules).
Arguments:
schema: DBIx::Class schema
table: name of the target table
Returns the number of records in the target table.
col_name: name of the target column
result_class: result class involving the target column
Returns the maximum value of the passed in column.
Returns the maximum length of the passed in column.
colname_array_ref: reference to the complete array of column names of the target table
Returns a string defining a parametrized insert statement for the target table.
dbh: DBI database handle
Prepares an insert statement.
sth_insert: handle of a prepared insert statement
all_vals: the values to be used for the insert statement
Executes an insert statement.
cols_and_values: reference to a hash having as keys column names of the target table and as values corresponding values.
Adds a new row to the target table. Is used in case we have an auto-increment column, there is a self-reference and the root nodes are identified by having "pkey = referenced pkey". In this case, we need to know the value of the auto-increment column for the new record and this can easily be determined from the DBIx::Class::Row object itself. For performance reasons, we don't use Row objects for the other inserts, in those cases, we use plain DBI.
Argument: DBI database handle.
Executes a commit.
Disconnects from the target database.
Jose Diaz Seng, <josediazseng at gmx.de>
<josediazseng at gmx.de>
Copyright (C) 2012-2013, Jose Diaz Seng.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.
To install DBIx::Table::TestDataGenerator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Table::TestDataGenerator
CPAN shell
perl -MCPAN -e shell install DBIx::Table::TestDataGenerator
For more information on module installation, please visit the detailed CPAN module installation guide.