=pod =head1 NAME SQL::Amazon::UserGuide - User Guide for DBD/SQL::Amazon =head1 SQL::Amazon SYNOPSIS # # create the parser, passing in the current Amazon metadata # my $parser = SQL::Amazon::Parser->new(\%attrs); # # parse a SQL statement, returning a SQL::Amazon::Statement # my $stmt = $parser->parse($sql_stmt) or die "Parse failed: " . $parser->errstr; # # evaluate the parse tree, using an evaluation object # for driver specific evaluation # returns either a scalar rowcount for write operations, # or a SQL::Amazon::Table object for SELECT # or undef on error # my $results = $stmt->execute($params) or die "Evaluation failed: " . $stmt->errstr; =head1 DESCRIPTION SQL::Amazon provides the various components required by B L to query the Amazon E-Commerce Service 4.0 I using SQL. B. The suite includes the following components: =over 4 =item B provides SQL parsing and query plan generation. Implemented as a subclass of L, part of the L bundle. =item B provides SQL query plan execution. Implemented as a subclass of L. =item B provides SQL::Amazon-specific predicate functions, including B. =item B provides a factory class for generating SQL::Amazon::Request::Request objects based on the predicates in a query's WHERE clause. =item B provides a temporary storage object for intermediate results extracted from the base table cache objects. Acts as a L object for L processing. =item B provides a global storage engine for managing data caching and retrieval. =item B provides a base class for all ECS request objects, including numerous default method implementations for building and sending requests, and processing the responses into the base table cache objects. =item B a subclass of SQL::Amazon::Request::Request for the ItemLookup request; also acts as a base class for the ItemSearch request. =item B a subclass of SQL::Amazon::Request::ItemLookup for the ItemSearch request =item B provides a base class for table cache objects, including methods for data type conversion, keyed lookup, and cache management. =item B> provides table-specific implementations of the Table base class. =back =head2 Prerequisites Perl 5.8.0 L 1.10 L 0.15 L 1.47 L 2.09 L I> =head2 SQL Dialect SQL::Amazon::Parser currently supports the same subset of standard SQL as supported by L, using the L dialect, with the following additional predicate functions for keyword searches: =over 4 =item BEIEB<)> Results in generation of an ECS ItemSearch request, with either the Keywords parameter (for MATCHES ALL), Power parameter (for MATCHES ANY), or TextStream parameter (for MATCHES TEXT). =item BEIEB<)> Results in generation of an ECS ItemSearch request, with either Power parameters. Individual items in the I are wrapped in parentheses, and joined with 'and' operators. =back =head2 Special SQL Considerations =head4 Mapping ECS Hierarchical Response Data to Relational Structures The hierarchical structure of the data returned by the Amazon ECS requires some manipulation by SQL::Amazon to conform to a flattened relational model. As a result, queries against the B table may cause multiple tables to be populated, e.g., B, etc. This behavior is especially true when the B parameter is set to B I<(the default)>, in which case all detail information about matching books is returned. As a result, some queries require the use of JOINs to properly reflect the data model abstraction. E.g., When searching for only New books, the B ECS request parameter must be applied; however, B is a column in the B table, B the B table. Hence, a JOIN between the B table and B table on the B column is required, along with a predicate test for B. The JOIN is required, even though the returned B