DBIx-PgLink

 view release on metacpan or  search on metacpan

lib/DBIx/PgLink/Accessor/BaseAccessor.pm  view on Meta::CPAN

has 'local_object'        => (is=>'ro', isa=>'Str', required=>1);

# full qualified, double-quoted name
has 'local_schema_quoted'   => (is=>'rw', isa=>'Str', lazy=>1, default=>sub{ $_[0]->QLI($_[0]->local_schema) } );
has 'local_object_quoted'   => (is=>'rw', isa=>'Str', lazy=>1, default=>sub{ $_[0]->QLIS($_[0]->local_object) } );
has 'remote_object_quoted'  => (is=>'rw', isa=>'Str', lazy=>1, default=>sub{ $_[0]->QRIS($_[0]->remote_object) } );


has 'old_accessor' => (is=>'rw', isa=>'DBIx::PgLink::Accessor::BaseAccessor');

has 'skip_on_errors' => (is=>'ro', isa=>'ArrayRef', auto_deref=>1,
  default=>sub{ ['cannot drop .* because other objects depend on it']} 
);

# -------------------------------------------------------


method build => named (
  use_local_metadata  => { isa => 'Bool', default=> 0 },
) => sub {
  my ($self, $p) = @_;

lib/DBIx/PgLink/Accessor/Routine.pm  view on Meta::CPAN

  lazy       => 1,
  default    => sub { 
    my $self = shift;
    return $self->building_mode 
      ? $self->get_remote_arguments
      : $self->load_arguments
  },
);


has 'routine_info' => ( is=>'ro', isa=>'HashRef' ); # passed by build_accessors
has 'remote_routine_name' => (is=>'ro', isa=>'Str', required=>1 );
has 'returns_set' => (is=>'ro', isa=>'Bool', lazy=>1,
  default => sub {
    my $self = shift;
    return ($self->columns->metadata) ? 1 : 0; # has non-empty column list?
  }
);

my %name_attr = (is=>'ro', isa=>'Str', lazy=>1);

lib/DBIx/PgLink/Accessor/Table.pm  view on Meta::CPAN

    remote_schema      => $meta->{TABLE_SCHEM},
    remote_object      => $meta->{TABLE_NAME},
    remote_object_type => $meta->{TABLE_TYPE},
    table_info         => $meta,
  );
}


# -------------------------------------------------------

has 'table_info' => ( is=>'ro', isa=>'HashRef' ); # passed by build_accessors

# NAMES

my %name_attr = (is=>'ro', isa=>'Str', lazy=>1);

# name without schema or quoting
has 'function'           => (%name_attr, default=>sub{ $_[0]->local_object . '$' });
  # $-suffix to prevent collision with remote function accessor
has 'view'               => (%name_attr, default=>sub{ $_[0]->local_object });
has 'rowtype'            => (%name_attr, default=>sub{ $_[0]->local_object . '_rowtype' });

lib/DBIx/PgLink/Adapter/SybaseASE.pm  view on Meta::CPAN

        method    => $func,
        defined $attr ? %{$attr} : (),
      );
    } else {
      return $next->($self, $statement, $attr);
    }
  };
}

has 'quote_literal_types' => ( # initialize once for connection
  is=>'ro', isa=>'HashRef', lazy=>1, 
  default=>sub { 
    return {
      SQL_BINARY()    => undef,
      SQL_BLOB()      => undef,
      SQL_CHAR()      => undef,
      SQL_DATE()      => undef,
      SQL_VARBINARY() => undef,
      SQL_VARCHAR()   => undef,
  } },
);

lib/DBIx/PgLink/RemoteAction.pm  view on Meta::CPAN

    $st->{sth}->execute(@{$param_values});
  }
}


# cache to the session end
memoize 'remote_statement_prepare_cached';


# store session-level filter for SELECT remote data, by object_id
has 'query_session_filter' => (is=>'ro', isa=>'HashRef', default=>sub{{}} );


method remote_accessor_query => named (
  object_id    => { isa=>'Int', required=>1 },
  where        => { isa=>'Str', required=>0, default=>'' },
  param_values => { isa=>'PostgreSQLArray', required=>0, coerce=>1, default=>[] },
  param_types  => { isa=>'PostgreSQLArray', required=>0, coerce=>1, default=>[] },
) => sub {
  my ($self, $p) = @_;

lib/DBIx/PgLink/TypeMapper.pm  view on Meta::CPAN



has 'data_type_map' => ( 
  is      => 'rw',
  isa     => 'HashRef[TypeMap]',
  lazy    => 1,
  default => \&load_data_type_map,
);


has 'sql_type_name_to_code' => (is=>'ro', isa=>'HashRef', lazy=>1,
  default => sub {
    my %map;
    for my $symbol (@{ $DBI::EXPORT_TAGS{sql_types} }) {
      no strict 'refs';
      my $code = &{"DBI::$symbol"}();
      (my $short = $symbol) =~ s/^SQL_//;
      $map{$symbol} = $code;  # 'SQL_INTEGER' -> 4
      $map{$short}  = $code;  # 'INTEGER' -> 4
      $map{$code}   = $code;  # '4' -> 4
    }



( run in 0.811 second using v1.01-cache-2.11-cpan-5f2e87ce722 )