NAME
JsonSQL::Param::InsertValues - JsonSQL::Param::InsertValues object. Stores a Perl representation of the VALUES parameter of an INSERT statement.
VERSION
version 0.4
SYNOPSIS
This module constructs a Perl object representing the VALUES parameter of an SQL INSERT statement and has methods for generating the appropriate SQL string and bind values for use with the DBI module.
DESCRIPTION
Object properties:
Generated parameters:
- $columns => "column1,column2,..."
- $placeholders => "?,?,..."
-
(One ? for each column)
- $values => [value1,value2,...]
METHODS
Constructor new($insertvaluesarrayref, $queryObj, $insert_table_rules)
Instantiates and returns a new JsonSQL::Param::InsertValues object.
$insertvaluesarrayref => An arrayref of column/value hashes used to construct the object.
$queryObj => A reference to the JsonSQL::Query object that will own this object.
$insert_table_rules => The whitelist table rules used to validate access to the table columns for INSERT.
Returns a JsonSQL::Error object on failure.
ObjectMethod get_insert_param_strings -> ( $columns, $placeholders, $values )
Generates parameters represented by the object for the SQL statement. Returns:
$columns => A string of columns to use for the INSERT statement.
$placeholders => A placeholder string to use for parameterized VALUES.
$values => An arrayref of values to match the parameterized $columns and $placeholders strings.
AUTHOR
Chris Hoefler <bhoefler@draper.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Chris Hoefler.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.