introduce SELECT capability and skeleton test
[dbsrgits/Data-Query.git] / lib / Data / Query / ExprHelpers.pm
CommitLineData
12e6eab8 1package Data::Query::ExprHelpers;
2
3use strictures 1;
9c8fc055 4use Data::Query::Constants qw(DQ_VALUE DQ_OPERATOR DQ_IDENTIFIER);
12e6eab8 5
6use base qw(Exporter);
7
9c8fc055 8our @EXPORT_OK = qw(perl_scalar_value perl_operator identifier);
12e6eab8 9
10sub perl_scalar_value {
11 +{
9c8fc055 12 type => DQ_VALUE,
13 subtype => { Perl => 'Scalar' },
14 value => $_[0]
12e6eab8 15 }
16}
17
18sub perl_operator {
19 my ($op, @args) = @_;
20 +{
21 type => DQ_OPERATOR,
22 operator => { Perl => $op },
23 args => \@args
24 }
25}
26
9c8fc055 27sub identifier {
28 +{
29 type => DQ_IDENTIFIER,
30 elements => [ @_ ]
31 }
32}
33
12e6eab8 341;