DB-Object
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/DB/Object/Cache/Tables.pm view on Meta::CPAN
$cache->{ $hash->{host} }->{ $hash->{driver} }->{ $hash->{port} }->{ $hash->{database} }->{timestamp} = time();
if( !defined( $self->write( $cache ) ) )
{
return;
}
return( $self );
}
sub timeout { return( shift->_set_get_number( 'timeout', @_ ) ); }
sub updated { return( shift->_set_get_number( 'updated', @_ ) ); }
sub write
{
my $self = shift( @_ );
my $hash = shift( @_ ) || return( $self->error( "No table cache data was provided to write to cache file \"", $self->cache_file, "\"." ) );
my $tables_cache_file = shift( @_ ) || $self->cache_file || return( $self->error( "No cache file was set to write data to it." ) );
$tables_cache_file = $self->new_file( $tables_cache_file );
return( $self->error( "Tables cache data provided is not an hash reference." ) ) if( ref( $hash ) ne 'HASH' );
my $j = JSON->new->allow_nonref;
if( my $fh = $tables_cache_file->open_utf8( '>' ) )
lib/DB/Object/Mysql/Query.pm view on Meta::CPAN
{
$self->{ $field } = [];
}
return( $self );
}
# Not supported in MySQL
# sub returning
# Inherited from DB::Object::Query
# sub update
sub _query_components
{
my $self = shift( @_ );
my $type = ( @_ > 0 && lc( shift( @_ ) ) ) || $self->_query_type() || return( $self->error( "You must specify a query type: select, insert, update or delete" ) );
my $opts = $self->_get_args_as_hash( @_ );
# ok options:
# no_bind_copy: because join for example does it already and this would duplicate the binded types, so we use this option to tell this method to set an exception. Kind of a hack that needs clean-up in the future from a design point of view.
$opts->{no_bind_copy} //= 0;
my( $where, $group, $having, $sort, $order, $limit, $on_conflict );
lib/DB/Object/Postgres.pm view on Meta::CPAN
}
# sub unix_timestamp
sub unlock
{
shift->error( "unlock() does not work with Postgres." );
}
# See DB::Object
# sub update
# See DB::Object
# sub use
# See DB::Object
# sub use_cache
# See DB::Object
# sub use_bind
lib/DB/Object/Query.pm view on Meta::CPAN
$ref = shift( @_ ) if( @_ && @_ % 2 );
my %hash = ( @_ );
$ref ||= \%hash;
$self->{tie} = $ref;
}
return( wantarray() ? %{$self->{tie}} : $self->{tie} );
}
sub unix_timestamp { return( shift->_set_get_array_as_object( 'unix_timestamp', @_ ) ); }
sub update
{
my $self = shift( @_ );
my $data = shift( @_ ) if( @_ == 1 && ref( $_[ 0 ] ) );
my @arg = @_;
if( !@arg && $data )
{
if( $self->_is_hash( $data => 'strict' ) )
{
@arg = %$data;
}
lib/DB/Object/SQLite/Query.pm view on Meta::CPAN
# It could be a field name or a wildcard
return( $self->error( "A reference was provided (", ref( $_[0] ), "), but I was expecting a string, which could be a field name or even a star (*) indicating all fields." ) ) if( ref( $_[0] ) );
$self->{returning} = $self->new_clause({ value => shift( @_ ) });
}
# return( wantarray() ? () : undef() ) if( !$self->{returning} );
# return( wantarray() ? ( $self->{returning} ) : "RETURNING $self->{returning}" );
return( $self->{returning} );
}
# Inherited from DB::Object::Query
# sub update
sub _query_components
{
my $self = shift( @_ );
my $type = ( @_ > 0 && lc( shift( @_ ) ) ) || $self->_query_type() || return( $self->error( "You must specify a query type: select, insert, update or delete" ) );
my $opts = $self->_get_args_as_hash( @_ );
my $tbl_o = $self->{table_object} || return( $self->error( "No table object is set." ) );
my( $where, $group, $having, $sort, $order, $limit, $returning, $on_conflict );
$where = $self->where();
$limit = $self->limit();
lib/DB/Object/Tables.pm view on Meta::CPAN
sub unlock
{
my $self = shift( @_ );
my $class = ref( $self );
return( $self->error( "unlock() is not implemented by $class." ) );
}
sub unix_timestamp { return( shift->_method_to_query( 'unix_timestamp', @_ ) ); }
sub update
{
my $self = shift( @_ );
my $q = $self->_reset_query;
# If the user wants to execute this, then we reset the query,
# but if the user wants to call other methods chained like as_string we don't do anything
# CORE::delete( $self->{query_reset} ) if( !defined( wantarray() ) );
if( Want::want('VOID') || Want::want('OBJECT') )
{
CORE::delete( $self->{query_reset} ) if( Want::want('VOID') );
# return( $q->select( @_ ) );
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.588 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )