DQ_IDENTIFIER DQ_OPERATOR DQ_VALUE DQ_JOIN DQ_ALIAS DQ_ORDER DQ_LITERAL
);
-sub new {
- bless({ %{$_[1]||{}} }, (ref($_[0])||$_[0]))->BUILDALL;
-}
+use Moo;
-sub BUILDALL {
- my $self = shift;
- $self->{reserved_ident_parts}
- ||= (
- our $_DEFAULT_RESERVED ||= { map +($_ => 1), SQL::ReservedWords->words }
- );
- $self->{quote_chars}||=[''];
- $self->{simple_ops}||=$self->_default_simple_ops;
- return $self;
-}
+has reserved_ident_parts => (
+ is => 'ro', default => sub {
+ our $_DEFAULT_RESERVED ||= { map +($_ => 1), SQL::ReservedWords->words }
+ }
+);
+
+has quote_chars => (is => 'ro', default => sub { [''] });
+
+has simple_ops => (is => 'ro', builder => '_default_simple_ops');
sub _default_simple_ops {
+{
die "Unidentified identifier (SQL can no has \$_)"
unless my @i = @{$_[1]->{elements}};
# handle single or paired quote chars
- my ($q1, $q2) = @{$_[0]->{quote_chars}}[0,-1];
+ my ($q1, $q2) = @{$_[0]->quote_chars}[0,-1];
my $always_quote = $_[0]->{always_quote};
- my $res_check = $_[0]->{reserved_ident_parts};
+ my $res_check = $_[0]->reserved_ident_parts;
return [
join
$_[0]->{identifier_sep}||'.',