Boilerplate for public SQLA(1) functions
[dbsrgits/SQL-Abstract-2.0-ish.git] / lib / SQL / Abstract / Compat.pm
1 use MooseX::Declare;
2
3 class SQL::Abstract::Compat {
4
5   use Moose::Util::TypeConstraints;
6   use MooseX::Types -declare => [qw/LogicEnum/];
7
8   enum LogicEnum, qw(OR AND);
9
10   clean;
11
12   has logic => (
13     is => 'rw',
14     isa => LogicEnum,
15     default => 'AND'
16   );
17
18   method select(Str|ArrayRef|ScalarRef $from, ArrayRef|Str $fields,
19                 Str|ScalarRef|ArrayRef|HashRef $where?,
20                 Str|ScalarRef|ArrayRef|HashRef $order?) {
21     return ("", );
22   }
23
24   method where(Str|ScalarRef|ArrayRef|HashRef $where?,
25                Str|ScalarRef|ArrayRef|HashRef $order?) {
26   }
27 }
28
29 =head1 NAME
30
31 SQL::Abstract::Compant - compatibility layer for SQL::Abstrct v 1.xx
32
33 =head1 DESCRIPTION
34
35 This class attempts to maintain the original behaviour of version 1 of
36 SQL::Abstract. It does this by internally converting to an AST and then using
37 the standard AST visitor.
38
39 If so desired, you can get hold of this transformed AST somehow. This is aimed
40 at libraries such as L<DBIx::Class> that use SQL::Abstract-style arrays or
41 hashes as part of their public interface.
42
43 =head1 AUTHOR
44
45 Ash Berlin C<< <ash@cpan.org> >>
46
47 =cut
48
49 1;