view release on metacpan or search on metacpan
t/regressions/preferences_table.t view on Meta::CPAN
use YAML::Any qw( LoadFile );
# Needs the following where-clause in the has_many()
# {
# where => { 'me.type' => 'artist' },
# cascade_delete => 0,
# cache_for => 1,
# }
BEGIN {
use loader qw(build_schema);
view all matches for this distribution
view release on metacpan or search on metacpan
t/02-schema-helper-row-definition.t view on Meta::CPAN
my $relationship_info = $schema->Book->result_source->relationship_info('editions');
my $expected_relationship_info = {
'attrs' => {
'accessor' => 'multi',
'cascade_copy' => 1,
'cascade_delete' => 1,
'is_depends_on' => 0,
'join_type' => 'LEFT'
},
'class' => 'TestFor::DBIx::Class::Smooth::Schema::Result::Edition',
'cond' => {
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/CDTest/Schema/Result/Artist.pm view on Meta::CPAN
__PACKAGE__->has_many(
"artwork_to_artists",
"CDTest::Schema::Result::ArtworkToArtist",
{ "foreign.artist_id" => "self.artistid" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 cds
Type: has_many
t/lib/CDTest/Schema/Result/Artist.pm view on Meta::CPAN
__PACKAGE__->has_many(
"cds",
"CDTest::Schema::Result::CD",
{ "foreign.artist" => "self.artistid" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 artwork_cds
Type: many_to_many
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Class/Tree/Mobius.pm view on Meta::CPAN
});
$class->has_many( '_children' => $1 => {
"foreign.".$class->_mobius_b_column => "self.".$class->_mobius_a_column,
"foreign.".$class->_mobius_d_column => "self.".$class->_mobius_c_column,
}, { cascade_delete => 0 });
}
Math::BigFloat->accuracy(53);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Class/Tree/NestedSet.pm view on Meta::CPAN
$class->has_many(
'nodes' => $class,
\%join_cond,{
order_by => "me.$left",
cascade_delete => 0,
},
);
$class->has_many(
'descendants' => $class,
\%join_cond, {
where => \"me.$left > parent.$left AND me.$right < parent.$right", #"
order_by => "me.$left",
from => "$table me, $table parent",
cascade_delete => 0,
},
);
$class->has_many(
'children' => $class,
\%join_cond, {
where => \"me.$left > parent.$left AND me.$right < parent.$right AND me.$level = parent.$level + 1", #"
order_by => "me.$left",
from => "$table me, $table parent",
cascade_delete => 0,
},
);
$class->has_many(
'ancestors' => $class,
\%join_cond, {
where => \"child.$left > me.$left AND child.$right < me.$right", #"
order_by => "me.$right",
from => "$table me, $table child",
cascade_delete => 0,
},
);
$class->_tree_columns($args);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Class/Tree/AdjacencyList.pm view on Meta::CPAN
if (@_) {
my $parent_col = shift;
my $primary_col = ($class->primary_columns())[0];
$class->belongs_to( '_parent' => $class => { "foreign.$primary_col" => "self.$parent_col" } );
$class->has_many( 'children' => $class => { "foreign.$parent_col" => "self.$primary_col" } );
$class->has_many( 'parents' => $class => { "foreign.$primary_col" => "self.$parent_col" }, { cascade_delete => 0, cascade_copy => 0 } );
$class->_parent_column( $parent_col );
return 1;
}
return $class->_parent_column();
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Class/Visualizer.pm view on Meta::CPAN
"origin_table": "TableName",
"origin_column": "a_column_id",
"destination_table": "AnotherTableName"
"destination_column": "a_column_id",
"relation_type": "has_many",
"cascade_delete": 1,
},
...
],
}">a_column_id</text>
view all matches for this distribution
view release on metacpan or search on metacpan
DBO2/Fields.pm view on Meta::CPAN
=head3 restrict_delete Interface
Identical to the default interface except as follows: an ok_delete hook is installed to check for the existance of any related records, in which case the deletion is cancelled. This prevents you from deleting the "parent" record for a number of relat...
=head3 cascade_delete Interface
Identical to the default interface except as follows: a post_delete hook is installed to delete all of the related records after the parent record is deleted.
=head3 nullify_delete Interface
DBO2/Fields.pm view on Meta::CPAN
-params => {
delete_default => undef,
hook => { post_delete => 'nullify_*' }
},
},
cascade_delete => {
-base => 'default',
-params => {
hook => { post_delete => 'delete_*' }
},
},
view all matches for this distribution
view release on metacpan or search on metacpan
t/data/chado-cvterm.sql view on Meta::CPAN
create table db (
db_id serial not null,
primary key (db_id),
name varchar(255) not null,
contact_id int,
foreign key (contact_id) references contact (contact_id) on delete cascade INITIALLY DEFERRED,
description varchar(255) null,
urlprefix varchar(255) null,
url varchar(255) null,
constraint db_c1 unique (name)
);
t/data/chado-cvterm.sql view on Meta::CPAN
create table dbxref (
dbxref_id serial not null,
primary key (dbxref_id),
db_id int not null,
foreign key (db_id) references db (db_id) on delete cascade INITIALLY DEFERRED,
accession varchar(255) not null,
version varchar(255) not null default '',
description text,
constraint dbxref_c1 unique (db_id,accession,version)
);
t/data/chado-cvterm.sql view on Meta::CPAN
create table cvterm (
cvterm_id serial not null,
primary key (cvterm_id),
cv_id int not null,
foreign key (cv_id) references cv (cv_id) on delete cascade INITIALLY DEFERRED,
name varchar(1024) not null,
definition text,
dbxref_id int not null,
foreign key (dbxref_id) references dbxref (dbxref_id) on delete set null INITIALLY DEFERRED,
is_obsolete int not null default 0,
t/data/chado-cvterm.sql view on Meta::CPAN
create table cvterm_relationship (
cvterm_relationship_id serial not null,
primary key (cvterm_relationship_id),
type_id int not null,
foreign key (type_id) references cvterm (cvterm_id) on delete cascade INITIALLY DEFERRED,
subject_id int not null,
foreign key (subject_id) references cvterm (cvterm_id) on delete cascade INITIALLY DEFERRED,
object_id int not null,
foreign key (object_id) references cvterm (cvterm_id) on delete cascade INITIALLY DEFERRED,
constraint cvterm_relationship_c1 unique (subject_id,object_id,type_id)
);
COMMENT ON TABLE cvterm_relationship IS
'A relationship linking two cvterms. A relationship can be thought of
as an edge in a graph, or as a natural language statement about
t/data/chado-cvterm.sql view on Meta::CPAN
cvtermpath_id serial not null,
primary key (cvtermpath_id),
type_id int,
foreign key (type_id) references cvterm (cvterm_id) on delete set null INITIALLY DEFERRED,
subject_id int not null,
foreign key (subject_id) references cvterm (cvterm_id) on delete cascade INITIALLY DEFERRED,
object_id int not null,
foreign key (object_id) references cvterm (cvterm_id) on delete cascade INITIALLY DEFERRED,
cv_id int not null,
foreign key (cv_id) references cv (cv_id) on delete cascade INITIALLY DEFERRED,
pathdistance int,
constraint cvtermpath_c1 unique (subject_id,object_id,type_id,pathdistance)
);
create index cvtermpath_idx1 on cvtermpath (type_id);
create index cvtermpath_idx2 on cvtermpath (subject_id);
t/data/chado-cvterm.sql view on Meta::CPAN
create table cvtermsynonym (
cvtermsynonym_id serial not null,
primary key (cvtermsynonym_id),
cvterm_id int not null,
foreign key (cvterm_id) references cvterm (cvterm_id) on delete cascade INITIALLY DEFERRED,
synonym varchar(1024) not null,
type_id int,
foreign key (type_id) references cvterm (cvterm_id) on delete cascade INITIALLY DEFERRED,
constraint cvtermsynonym_c1 unique (cvterm_id,synonym)
);
create index cvtermsynonym_idx1 on cvtermsynonym (cvterm_id);
-- ================================================
t/data/chado-cvterm.sql view on Meta::CPAN
create table cvterm_dbxref (
cvterm_dbxref_id serial not null,
primary key (cvterm_dbxref_id),
cvterm_id int not null,
foreign key (cvterm_id) references cvterm (cvterm_id) on delete cascade INITIALLY DEFERRED,
dbxref_id int not null,
foreign key (dbxref_id) references dbxref (dbxref_id) on delete cascade INITIALLY DEFERRED,
is_for_definition int not null default 0,
constraint cvterm_dbxref_c1 unique (cvterm_id,dbxref_id)
);
create index cvterm_dbxref_idx1 on cvterm_dbxref (cvterm_id);
create index cvterm_dbxref_idx2 on cvterm_dbxref (dbxref_id);
t/data/chado-cvterm.sql view on Meta::CPAN
create table cvtermprop (
cvtermprop_id serial not null,
primary key (cvtermprop_id),
cvterm_id int not null,
foreign key (cvterm_id) references cvterm (cvterm_id) on delete cascade,
type_id int not null,
foreign key (type_id) references cvterm (cvterm_id) on delete cascade,
value text not null default '',
rank int not null default 0,
unique(cvterm_id, type_id, value, rank)
);
t/data/chado-cvterm.sql view on Meta::CPAN
create table organism_dbxref (
organism_dbxref_id serial not null,
primary key (organism_dbxref_id),
organism_id int not null,
foreign key (organism_id) references organism (organism_id) on delete cascade INITIALLY DEFERRED,
dbxref_id int not null,
foreign key (dbxref_id) references dbxref (dbxref_id) on delete cascade INITIALLY DEFERRED,
constraint organism_dbxref_c1 unique (organism_id,dbxref_id)
);
create index organism_dbxref_idx1 on organism_dbxref (organism_id);
create index organism_dbxref_idx2 on organism_dbxref (dbxref_id);
t/data/chado-cvterm.sql view on Meta::CPAN
create table organismprop (
organismprop_id serial not null,
primary key (organismprop_id),
organism_id int not null,
foreign key (organism_id) references organism (organism_id) on delete cascade INITIALLY DEFERRED,
type_id int not null,
foreign key (type_id) references cvterm (cvterm_id) on delete cascade INITIALLY DEFERRED,
value text null,
rank int not null default 0,
constraint organismprop_c1 unique (organism_id,type_id,rank)
);
create index organismprop_idx1 on organismprop (organism_id);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/DataModel.pm view on Meta::CPAN
C<DBIx::DataModel> does not keep track of data mutations
in memory, and therefore provides no support for automatically
propagating changes into the database; the client code has to
explicitly manage C<insert> and C<update> operations.
=item no 'cascaded update' nor 'insert or update'
Cascaded inserts and deletes are supported, but not cascaded updates.
This would need 'insert or update', which is not supported.
=back
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/EAV.pm view on Meta::CPAN
my ( $orig, $class, @args ) = @_;
my $params = @args == 1 && ref $args[0] ? $args[0] : { @args };
my $schema_config = delete $params->{schema_config} || {};
my @schema_params = grep { exists $params->{$_} } qw/
tenant_id data_types database_cascade_delete static_attributes
table_prefix id_type default_attribute_type enable_multi_tenancy
/;
@{$schema_config}{@schema_params} = delete @{$params}{@schema_params};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/MyDatabaseMunger.pm view on Meta::CPAN
} elsif( $line =~ m/^\s*
CONSTRAINT\s+`(.*)`\s+
FOREIGN\s+KEY\s+\(`(.*)`\)\s+
REFERENCES\s+`(.*)`\s+\(`(.*)`\)\s+(.*)
/x ) {
my($name, $cols, $reftable, $refcols, $cascade_opt) =
($1, $2, $3, $4, $5);
my @cols = split '`,`', $cols;
my @refcols = split '`,`', $refcols;
push @constraints, $name;
$constraint_definition{ $name } = {
name => $name,
columns => \@cols,
reference_table => $reftable,
reference_columns => \@refcols,
cascade_opt => $cascade_opt,
};
} else {
warn "Don't understand line in CREATE TABLE:\n$line";
}
}
lib/DBIx/MyDatabaseMunger.pm view on Meta::CPAN
return "CONSTRAINT `$constraint->{name}` FOREIGN KEY (`"
. join('`,`', @{$constraint->{columns}})
. "`) REFERENCES `$constraint->{reference_table}` (`"
. join('`,`', @{$constraint->{reference_columns}})
. "`)" . (
$constraint->{cascade_opt} ? " $constraint->{cascade_opt}" : ''
);
}
=item $o->queue_add_table_constraint ( $table, $constraint )
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/MyParse/Query.pm view on Meta::CPAN
return "DROP DATABASE ".$drop_if_exists.$query->getSchemaSelect()->print();
} elsif ($command eq 'SQLCOM_DROP_TABLE') {
my $drop_if_exists = $query->getOption("DROP_IF_EXISTS") ? "IF EXISTS " : "";
my $drop_temporary = $query->getOption("DROP_TEMPORARY") ? "TEMPORARY " : "";
my $drop_restrict = $query->getOption("DROP_RESTRICT") ? " RESTRICT" : "";
my $drop_cascade = $query->getOption("DROP_CASCADE") ? " CASCADE" : "";
return "DROP ".$drop_temporary."TABLE ".$drop_if_exists.join(', ', map { $_->_printTable(0) } @{$query->getTables()}).$drop_restrict.$drop_cascade;
}
}
sub _printCreate {
my $query = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/NoSQL/Store/Manager/StoreModel.pm view on Meta::CPAN
isa => 'Str',
required => 1,
predicate => 'has_store_model',
);
has cascade_model => (
is => 'ro',
isa => 'Bool',
default => sub { 0 },
);
has cascade_save => (
is => 'ro',
isa => 'Bool',
lazy => 1,
default => sub { $_[0]->cascade_model },
);
has cascade_delete => (
is => 'ro',
isa => 'Bool',
lazy => 1,
default => sub { $_[0]->cascade_model },
);
use Types::Standard qw/ InstanceOf Str HashRef ArrayRef ConsumerOf /;
before _process_options => sub ( $meta, $name, $options ) {
lib/DBIx/NoSQL/Store/Manager/StoreModel.pm view on Meta::CPAN
$main_class->add_before_method_modifier( delete => sub ( $self, @) {
my $obj = $self->$reader or return;
$_->delete for $array_context ? @$obj : $obj;
}) if $attr->cascade_delete;
$main_class->add_before_method_modifier( $attr->get_read_method => sub ( $self, @rest ) {
return if @rest;
my $value = $attr->get_value( $self );
lib/DBIx/NoSQL/Store/Manager/StoreModel.pm view on Meta::CPAN
] : $val->store_key;
}
return $packed;
} );
if( $attr->cascade_save ) {
$main_class->add_before_method_modifier( 'save' => sub ( $self, $store=undef ) {
# TODO bug if we remove the value altogether
my $value = $self->$reader or return;
if ( $attr->cascade_delete ) {
my $priors = eval { $self->store_db->get( $self->store_model, $self->store_key )->$reader };
if ( $array_context ) {
my %priors = map { $_->store_key => $_ } @$priors;
for ( @$value ) {
lib/DBIx/NoSQL/Store/Manager/StoreModel.pm view on Meta::CPAN
package Blog::Model::Entry;
has author => (
traits => [ 'StoreModel' ],
store_model => 'Blog::Model::Author',
cascade_save => 1,
cascade_delete => 0,
is => 'rw',
);
=head1 DESCRIPTION
lib/DBIx/NoSQL/Store/Manager/StoreModel.pm view on Meta::CPAN
Required. Takes in the model associated with the target attribute.
Will automatically populate the C<isa> attribute to
C<$model_class|Str_HashRef>.
=head2 cascade_model => $boolean
Sets the default of C<cascade_save> and C<cascade_delete>.
Defaults to C<false>.
=head2 cascade_save => $boolean
If C<true> the object associated with the attribute is automatically saved
to the store when the main object is C<save()>d.
=head2 cascade_delete => $boolean
If C<true>, deletes the attribute object (if there is any)
from the store when the main object is C<delete()>d.
If both C<cascade_delete> and C<cascade_save> are C<true>,
then when saving the main object, if the attribute object has been
modified, its previous value will be deleted from the store.
# assuming the author attribute has `cascade_model => 1`...
my $blog_entry = $store->create( 'Entry',
author => Blog::Model::Author->new(
name => 'yanick',
bio => 'necrohacker',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/ObjectMapper/Mapper/Instance.pm view on Meta::CPAN
elsif( $status_name eq 'detached' ) {
my $class_mapper = $self->instance->__class_mapper__;
for my $prop_name ( $class_mapper->attributes->property_names ) {
my $prop = $class_mapper->attributes->property_info($prop_name);
next unless $prop->type eq 'relation';
if( $prop->{isa}->is_cascade_detach() ) {
if( my $instance = $self->get_val($prop_name) ) {
my @instance
= ref $instance eq 'ARRAY'
? @$instance
: ($instance);
lib/DBIx/ObjectMapper/Mapper/Instance.pm view on Meta::CPAN
elsif( $status_name eq 'expired' ) {
my $class_mapper = $self->instance->__class_mapper__;
for my $prop_name ( $class_mapper->attributes->property_names ) {
my $prop = $class_mapper->attributes->property_info($prop_name);
next unless $prop->type eq 'relation';
if( $prop->{isa}->is_cascade_reflesh_expire() ) {
if( my $instance = $self->get_val($prop_name) ) {
my @instance
= ref $instance eq 'ARRAY'
? @$instance
: ($instance);
lib/DBIx/ObjectMapper/Mapper/Instance.pm view on Meta::CPAN
$self->initialize;
for my $prop_name ( $class_mapper->attributes->property_names ) {
my $prop = $class_mapper->attributes->property_info($prop_name);
next unless $prop->type eq 'relation';
if( $prop->{isa}->is_cascade_reflesh_expire() ) {
if( my $instance = $self->get_val($prop_name) ) {
my @instance
= ref $instance eq 'ARRAY'
? @$instance
: ($instance);
lib/DBIx/ObjectMapper/Mapper/Instance.pm view on Meta::CPAN
my $uniq_cond = $self->identity_condition;
my $class_mapper = $self->instance->__class_mapper__;
my $result;
try {
my @after_cascade;
for my $prop_name ( $class_mapper->attributes->property_names ) {
my $prop = $class_mapper->attributes->property_info($prop_name);
next unless $prop->type eq 'relation';
if (ref( $prop->{isa} ) eq
'DBIx::ObjectMapper::Relation::BelongsTo' )
{
if ( $prop->{isa}->is_cascade_save_update() ) {
$prop->{isa}->cascade_update($self);
}
if( $modified_data->{$prop_name} ) {
$prop->{isa}->set_val_from_object(
$self,
$self->get_val($prop_name),
);
}
}
elsif ( $prop->{isa}->is_cascade_save_update() ) {
push @after_cascade, $prop;
}
}
my $new_val;
if( keys %$modified_data ) {
lib/DBIx/ObjectMapper/Mapper/Instance.pm view on Meta::CPAN
$reduce_data,
$modified_data
);
}
for my $c ( @after_cascade ) {
$c->{isa}->cascade_update( $self );
}
$self->_release_many_to_many_event;
$self->_modify($new_val) if $new_val;
} catch {
lib/DBIx/ObjectMapper/Mapper/Instance.pm view on Meta::CPAN
};
$self->{is_modified} = 0;
$self->{modified_data} = +{};
$self->change_status('expired'); # cascade expire if cascade_reflesh_expire
return !$result || $self->instance;
}
sub save {
my ( $self ) = @_;
confess 'it need to be "pending" status.' unless $self->is_pending;
my $class_mapper = $self->instance->__class_mapper__;
try {
my @after_cascade;
for my $prop_name ( $class_mapper->attributes->property_names ) {
my $prop = $class_mapper->attributes->property_info($prop_name);
if ( $prop->type eq 'relation' ) {
if (ref( $prop->{isa} ) eq
'DBIx::ObjectMapper::Relation::BelongsTo' )
lib/DBIx/ObjectMapper/Mapper/Instance.pm view on Meta::CPAN
my @instances
= ref $instance eq 'ARRAY'
? @$instance
: ($instance);
for my $i (@instances) {
if( $prop->{isa}->is_cascade_save_update() ) {
$prop->{isa}->cascade_save( $self, $i );
}
else {
$prop->{isa}->set_val_from_object( $self, $i );
}
}
}
}
elsif( $prop->{isa}->is_cascade_save_update() ) {
push @after_cascade, $prop;
}
}
}
my $reduce_data = $self->reducing;
my $data = { %$reduce_data, %{$class_mapper->default_value} };
my $comp_result = $class_mapper->insert(%$data);
$self->_modify($comp_result);
$self->initialize;
for my $c ( @after_cascade ) {
if ( my $instance = $self->get_val($c->name) ) {
my @instances
= ref $instance eq 'ARRAY'
? @$instance
: ($instance);
for my $i (@instances) {
$c->{isa}->cascade_save( $self, $i );
}
}
}
} catch {
lib/DBIx/ObjectMapper/Mapper/Instance.pm view on Meta::CPAN
my $uniq_cond = $self->identity_condition;
my $class_mapper = $self->instance->__class_mapper__;
my $result;
try {
my @after_cascade;
$deleted_key->{$self->primary_cache_key} = 1;
for my $prop_name ( $class_mapper->attributes->property_names ) {
my $prop = $class_mapper->attributes->property_info($prop_name);
if ( $prop->type eq 'relation'
and $prop->{isa}->is_cascade_delete() )
{
if (ref( $prop->{isa} ) eq
'DBIx::ObjectMapper::Relation::BelongsTo' )
{
push @after_cascade, $prop;
}
else {
$self->_cascade_delete($prop, $deleted_key);
}
}
elsif( $prop->is_multi ) {
$prop->{isa}->deleted_parent($self);
}
}
$result = $class_mapper->delete(@$uniq_cond);
for my $c ( @after_cascade ) {
$self->_cascade_delete($c, $deleted_key);
}
} catch {
$self->change_status('detached');
confess $_[0];
};
$self->change_status('detached');
return $result;
}
sub _cascade_delete {
my ( $self, $prop, $deleted_key ) = @_;
$prop->{isa}->cascade_delete($self, $deleted_key);
if ( my $instance = $self->get_val($prop->name) ) {
my @instance
= ref $instance eq 'ARRAY'
? @$instance
: ($instance);
lib/DBIx/ObjectMapper/Mapper/Instance.pm view on Meta::CPAN
{
my $mapper_addr = refaddr($obj);
$self->_regist_many_to_many_event($name, $mapper_addr, 'remove');
}
elsif( $self->is_persistent ) {
if( $prop->{isa}->is_cascade_delete_orphan ) {
$self->unit_of_work->delete($obj);
}
else {
my $rel_val = $prop->{isa}->relation_value($self);
for my $r ( keys %$rel_val ) {
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/CDTest/Schema/Result/Artist.pm view on Meta::CPAN
__PACKAGE__->has_many(
"artwork_to_artists",
"CDTest::Schema::Result::ArtworkToArtist",
{ "foreign.artist_id" => "self.artistid" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 cds
Type: has_many
t/lib/CDTest/Schema/Result/Artist.pm view on Meta::CPAN
__PACKAGE__->has_many(
"cds",
"CDTest::Schema::Result::CD",
{ "foreign.artist" => "self.artistid" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 artwork_cds
Type: many_to_many
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/Patcher/Schema/Result/Patcher/Run.pm view on Meta::CPAN
__PACKAGE__->has_many(
"patches",
"DBIx::Patcher::Schema::Result::Patcher::Patch",
{ "foreign.run_id" => "self.id" },
{ cascade_copy => 0, cascade_delete => 0 },
);
# Created by DBIx::Class::Schema::Loader v0.07002 @ 2011-02-19 15:51:40
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Daqwau9crznJbGFbcJhF3Q
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DBIx/PgLink/Accessor/BaseAccessor.pm view on Meta::CPAN
{isa=>'Int', required=>1},
) => sub {
my ($self, $object_id) = @_;
# delete base row by id
# foreign key cascade to child metadata (columns, queries, etc)
pg_dbh->do(<<'END_OF_SQL',
DELETE FROM dbix_pglink.objects
WHERE object_id = $1
END_OF_SQL
{types=>[qw/INT4/]},
view all matches for this distribution
view release on metacpan or search on metacpan
t/builder.t view on Meta::CPAN
};
column person_id => sub {
sql_spec type => 'INTEGER';
references person => (on_delete => 'cascade');
};
column alias => sub {
sql_spec(type => 'VARCHAR(128)');
};
unique(qw/person_id alias/);
index unnecessary_index => qw/person_id alias/;
relation person_way2 => (table => 'person', using => 'person_id', on_delete => 'cascade');
relation sub { as 'person_way3'; table 'person'; using 'person_id'; on_delete 'cascade' };
relation as 'person_way4', rtable 'person', on {'person_id' => 'person_id'}, on_delete 'cascade';
relation as 'person_way5', rtable('person'), using 'person_id', on_delete 'cascade';
relation person_way6 => ('person' => ['person_id'], on_delete => 'cascade');
};
};
my ($pg_sql, $mariadb_sql, $sqlite_sql, $mysql_sql, $percona_sql);
subtest PostgreSQL => sub {
t/builder.t view on Meta::CPAN
$pg_sql = $orm->generate_schema_sql;
like($pg_sql, qr/CREATE EXTENSION "uuid-ossp";/, "Added extension");
like($pg_sql, qr/CREATE TYPE choice AS ENUM\('foo', 'bar', 'baz'\)/, "Added enum type");
like($pg_sql, qr/FOREIGN KEY\(person_id\) REFERENCES person\(person_id\) ON DELETE cascade/, "Added foreign key");
ok(lives { $orm->load_schema_sql($pg_sql) }, "loaded schema");
is([sort $orm->connection->tables], [qw/aliases person/], "Loaded both tables");
};
t/builder.t view on Meta::CPAN
isa_ok($orm, ['DBIx::QuickORM::ORM'], "Got correct ORM type");
ref_is(orm('simple_mysql'), $orm, "Instance cached");
is($orm->db, $pdb, "Orm uses the mysql database");
$mysql_sql = $orm->generate_schema_sql;
like($mysql_sql, qr/FOREIGN KEY\(person_id\) REFERENCES person\(person_id\) ON DELETE cascade/, "Added foreign key");
ok(lives { $orm->load_schema_sql($mysql_sql) }, "loaded schema");
is([sort $orm->connection->tables], [qw/aliases person/], "Loaded both tables");
};
t/builder.t view on Meta::CPAN
isa_ok($orm, ['DBIx::QuickORM::ORM'], "Got correct ORM type");
ref_is(orm('simple_percona'), $orm, "Instance cached");
is($orm->db, $pdb, "Orm uses the percona database");
$percona_sql = $orm->generate_schema_sql;
like($percona_sql, qr/FOREIGN KEY\(person_id\) REFERENCES person\(person_id\) ON DELETE cascade/, "Added foreign key");
ok(lives { $orm->load_schema_sql($percona_sql) }, "loaded schema");
is([sort $orm->connection->tables], [qw/aliases person/], "Loaded both tables");
};
t/builder.t view on Meta::CPAN
isa_ok($orm, ['DBIx::QuickORM::ORM'], "Got correct ORM type");
ref_is(orm('simple_mariadb'), $orm, "Instance cached");
is($orm->db, $pdb, "Orm uses the mariadb database");
$mariadb_sql = $orm->generate_schema_sql;
like($mariadb_sql, qr/FOREIGN KEY\(person_id\) REFERENCES person\(person_id\) ON DELETE cascade/, "Added foreign key");
ok(lives { $orm->load_schema_sql($mariadb_sql) }, "loaded schema");
is([sort $orm->connection->tables], [qw/aliases person/], "Loaded both tables");
};
t/builder.t view on Meta::CPAN
isa_ok($orm, ['DBIx::QuickORM::ORM'], "Got correct ORM type");
ref_is(orm('simple_sqlite'), $orm, "Instance cached");
is($orm->db, $pdb, "Orm uses the sqlite database");
$sqlite_sql = $orm->generate_schema_sql;
like($sqlite_sql, qr/FOREIGN KEY\(person_id\) REFERENCES person\(person_id\) ON DELETE cascade/, "Added foreign key");
ok(lives { $orm->load_schema_sql($sqlite_sql) }, "loaded schema");
is([sort $orm->connection->tables], [qw/aliases person/], "Loaded both tables");
};
view all matches for this distribution
view release on metacpan or search on metacpan
t/002_dsl.t view on Meta::CPAN
varchar 'name', null => 0;
integer 'author_id';
decimal 'price', size => [4,2];
enum 'classification', [qw/novel science/];
belongs_to 'author', on_delete => 'cascade';
};
create_table author => columns {
pk 'id';
varchar 'name';
t/002_dsl.t view on Meta::CPAN
ok $c->no_fk_translate;
ok my $ddl = $c->translate;
note $ddl;
like $ddl, qr/ON DELETE cascade/msi;
like $ddl, qr/on update CURRENT_TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP/msi;
like $ddl, qr/`classification` ENUM\('novel', 'science'\) NULL/msi;
ok $c->no_fk_translate ne $c->translate;
view all matches for this distribution
view release on metacpan or search on metacpan
- we use Encode module without perl version check for a long time, so we
can get rid of all checks for the version and load the module at compile
time everywhere we need it
- implement MayBeNull method in the handler that checks if applied
conditions allow NULLs in the result set
- implement cascaded LEFT JOINs optimization
- additional tests for CleanSlate and Clone methods, ENTRY_AGGREGATOR
argument, different types of joins and LEFT JOIN optimizer
1.45 2006-09-26
- Postgres: fix "$rec->Create();"
view all matches for this distribution
view release on metacpan or search on metacpan
],
undef,
$default_drop
);
test_drop(cascade =>
new_ok($mod, [{%def_args, drop_suffix => 'CASCADE'}]),
qr/DROP\s+TABLE/,
qr/"data"/,
qr/CASCADE/,
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DOCSIS/ConfigFile/mibs/DIFFSERV-MIB view on Meta::CPAN
-- This MIB supports a variety of Meters. It includes a specific
-- definition for Token Bucket Meter, which are but one type of
-- specification. Other metering parameter sets can be defined in other
-- MIBs.
-- Multiple meter elements may be logically cascaded using their
-- diffServMeterSucceedNext and diffServMeterFailNext pointers if
-- required. One example of this might be for an AF PHB implementation
-- that uses multiple level conformance meters.
-- Cascading of individual meter elements in the MIB is intended to be
view all matches for this distribution
view release on metacpan or search on metacpan
CAB/Analyzer/Automaton/Gfsm/XL.pm view on Meta::CPAN
## $aut = $aut->clear()
sub clear {
my $aut = shift;
$aut->{fst}->_cascade_set(undef) if ($aut->{fst});
##-- inherited
$aut->SUPER::clear();
}
CAB/Analyzer/Automaton/Gfsm/XL.pm view on Meta::CPAN
## + default labels class for loadLabels() method
sub labClass { return 'Gfsm::Alphabet'; }
## $bool = $aut->fstOk()
## + should return false iff fst is undefined or "empty"
sub fstOk { return defined($_[0]{fst}) && defined($_[0]{fst}->cascade) && $_[0]{fst}->cascade->depth>0; }
## $bool = $aut->labOk()
## + should return false iff label-set is undefined or "empty"
#(inherited)
CAB/Analyzer/Automaton/Gfsm/XL.pm view on Meta::CPAN
## $aut = $aut->loadCascade($cscfile)
## $aut = $aut->loadFst ($cscfile)
*loadFst = \&loadCascade;
sub loadCascade {
my ($aut,$cscfile) = @_;
$aut->info("loading cascade file '$cscfile'");
my $csc = Gfsm::XL::Cascade->new();
if (!$csc->load($cscfile)) {
$aut->logconfess("loadCascade(): load failed for '$cscfile': $!");
return undef;
}
CAB/Analyzer/Automaton/Gfsm/XL.pm view on Meta::CPAN
}
## $result = $aut->resultFst()
## + returns empty result FST
sub resultFst {
return Gfsm::Automaton->new($_[0]{fst}->cascade->semiring_type);
}
##--------------------------------------------------------------
## Methods: I/O: Input: Labels
view all matches for this distribution
view release on metacpan or search on metacpan
upgrade/0.2/upgrade.pl view on Meta::CPAN
add column short_title text
});
print STDERR " * wc_file.root_file_id\n";
$db->do(q{
alter table wc_file
add column root_file_id int references wc_file on delete cascade
});
print STDERR " * wc_file.article_pages_url\n";
$db->do(q{
alter table wc_file
add column article_pages_url text
upgrade/0.2/upgrade.pl view on Meta::CPAN
add column article_content text
});
print STDERR " * wc_article_extra_url\n";
$db->do(q<
create table wc_article_extra_url (
file_id int not null references wc_file on delete cascade,
url text not null,
content_type text not null
-- All ASCII characters allowed except 'tspecials' defined in RFC 2045.
check (content_type similar to '[-!#$\\\\%&''*+.0-9A-Z^\\\\_`a-z{|}~]+/[-!#$\\\\%&''*+.0-9A-Z^\\\\_`a-z{|}~]+'),
generator text not null
upgrade/0.2/upgrade.pl view on Meta::CPAN
);
>);
print STDERR " * wc_article_extra_template\n";
$db->do(q{
create table wc_article_extra_template (
file_id int not null references wc_file on delete cascade,
filename text not null
);
});
print STDERR " * wc_article_included_files\n";
$db->do(q{
create table wc_article_included_files (
file_id int not null references wc_file on delete cascade,
included_file_id int not null
references wc_file deferrable initially deferred
);
});
view all matches for this distribution
view release on metacpan or search on metacpan
share/debugtoolbar/js/prettify/lang-sql.js view on Meta::CPAN
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r Â\xa0"],["str",/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/],["kwd",/^(?:add|all|alter|and|any|as|asc|autho...
null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^[_a-z][\w-]*/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/]]),["sql"]);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer/Plugin/Interchange6/Cart.pm view on Meta::CPAN
);
}
}
}
# delete the old carts (cascade deletes related cart products)
$old_carts->delete;
}
=head2 remove
view all matches for this distribution
view release on metacpan or search on metacpan
bin/index-url.pl view on Meta::CPAN
warn "Index: $_\n" for grep { /^\Q$index_name/ } keys %indices;
# Connect to cluster at search1:9200, sniff all nodes and round-robin between them:
# Lame-ass config cascade
# Read from %ENV, $config, hard defaults, with different names,
# write to yet more different names
# Should merge with other config cascade
sub get_defaults {
my( %options ) = @_;
$options{ defaults } ||= {}; # premade defaults
my @names = @{ $options{ names } };
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer/Template/Xslate.pm view on Meta::CPAN
=over
=item Cascading
Dancer already provides a <cascade>-like feature, called a "layout", in order
to augment other template engines lacking such a feature. In order to use
Xslate's C<cascade>, turn off C<layout> by commenting out or removing the
appropriate line in your Dancer application config.
=item Smart HTML Escaping
Use of Dancer's C<layout> feature will cause HTML templates to be HTML-entity
encoded twice if Xslate's "smart HTML escaping" feature is enabled. Xslate's
C<type> option can be set to "text" to disable smart-escaping, or, once again,
C<layout> can be disabled in favor of C<cascade>.
=back
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Logger/Fluent.pm view on Meta::CPAN
Socket file location, defaults to undef as implemented in
L<Fluent::Logger>.
=item prefer_integer
Whether integer is preferred as cascaded to
Data::MessagePack->prefer_integer. Defaults to 1.
=item event_time
Whether event timestamps (includes nanoseconds as supported by
view all matches for this distribution