-# This returns the usage formated as a pod document
+# This returns the usage formatted as a pod document
sub pod {
my ($self) = @_;
return join qq{\n}, $self->pod_leader_text, $self->pod_option_text, $self->pod_authorlic_text;
=head1 DESCRIPTION
-Emulates the I<undocumnted> behavior of Class::DBI where the object can be accessed as a hash of columns. This is often used as a performance hack.
+Emulates the I<undocumented> behavior of Class::DBI where the object can be accessed as a hash of columns. This is often used as a performance hack.
my $column = $result->{column};
L<DBIx::Class> classes are proxy classes, therefore some different
techniques need to be employed for more than basic subclassing. In
this example we have a single user table that carries a boolean bit
-for admin. We would like like to give the admin users
+for admin. We would like to give the admin users
objects (L<DBIx::Class::Row>) the same methods as a regular user but
also special admin only methods. It doesn't make sense to create two
separate proxy-class files for this. We would be copying all the user
=head2 Filtering a relationship result set
-If you want to get a filtered result set, you can just add add to $attr as follows:
+If you want to get a filtered result set, you can just add to $attr as follows:
__PACKAGE__->has_many('pages' => 'Page', 'book', { where => { scrap => 0 } } );
1;
-By overridding the L<connection|DBIx::Class::Schama/connection>
+By overriding the L<connection|DBIx::Class::Schama/connection>
method and extracting a custom option from the provided \%attr hashref one can
then simply iterate over all the Schema's ResultSources, renaming them as
needed.
as the ORM loads all the relevant classes. This section examines
techniques for reducing the startup delay.
-These tips are are listed in order of decreasing effectiveness - so the
+These tips are listed in order of decreasing effectiveness - so the
first tip, if applicable, should have the greatest effect on your
application.
=item L<DBIx::Class::ResultSource> - Source/Table definition functions.
-=item L<DBIx::Class::Schema> - Overall sourcess, and connection container.
+=item L<DBIx::Class::Schema> - Overall sources, and connection container.
=item L<DBIx::Class::Relationship> - Simple relationship declarations.
=item .. use DBIx::Class across multiple databases?
-If your database server allows you to run querys across multiple
+If your database server allows you to run queries across multiple
databases at once, then so can DBIx::Class. All you need to do is make
sure you write the database name as part of the
L<DBIx::Class::ResultSource/table> call. Eg:
$result->discard_changes
-Discarding changes and refreshing from storage are two sides fo the same coin. When you
+Discarding changes and refreshing from storage are two sides of the same coin. When you
want to discard your local changes, just re-fetch the row from storage. When you want
to get a new, fresh copy of the row, just re-fetch the row from storage.
L<DBIx::Class::Row/discard_changes> does just that by re-fetching the row from storage
__PACKAGE__->table('foo'); # etc
-With either of these methods the resulting use of the accesssor would be
+With either of these methods the resulting use of the accessor would be
my $result;
=head2 Populate
-Made for inserting lots of rows very quicky into database
+Made for inserting lots of rows very quickly into database
$schema->populate([ Users =>
[qw( username password )],
=over 1
-=item Careful, get_column can basicaly mean B<three> things
+=item Careful, get_column can basically mean B<three> things
=item private in which case you should use an accessor
L<delete|DBIx::Class::Row/delete>,
L<update|DBIx::Class::Row/update>,
L<discard_changes|DBIx::Class::Row/discard_changes>,
-etc.) DBIx::Class will use the values of of the
+etc.) DBIx::Class will use the values of the
L<primary key|DBIx::Class::ResultSource/set_primary_key> columns to populate
the C<WHERE> clause necessary to accomplish the operation. This is why it is
important to declare a L<primary key|DBIx::Class::ResultSource/set_primary_key>
'=item Return Value: \%list_of_loaderrors_per_module',
'=back',
<<'EOD',
-Returns a hashref containing the actual errors that occured while attempting
+Returns a hashref containing the actual errors that occurred while attempting
to load each module in the requirement group.
EOD
'=head1 AUTHOR',
contain only plain values/deflatable objects, such that the result can be
passed directly to L<DBIx::Class::Relationship::Base/set_from_related>. For
instance the C<year> constraint in the above example prevents the relationship
-from being used to to create related objects (an exception will be thrown).
+from being used to create related objects (an exception will be thrown).
In order to allow the user to go truly crazy when generating a custom C<ON>
clause, the C<$args> hashref passed to the subroutine contains some extra
=item \%column
A hashref where each key is the accessor you want installed in the main class,
-and its value is the name of the original in the fireign class.
+and its value is the name of the original in the foreign class.
MyApp::Schema::Track->belongs_to( cd => 'DBICTest::Schema::CD', 'cd', {
proxy => { cd_title => 'title' },
sub belongs_to {
my ($class, $rel, $f_class, $cond, $attrs) = @_;
- # assume a foreign key contraint unless defined otherwise
+ # assume a foreign key constraint unless defined otherwise
$attrs->{is_foreign_key_constraint} = 1
if not exists $attrs->{is_foreign_key_constraint};
$attrs->{undef_on_null_fk} = 1
: 'classic_nonpruning'
;
- # $args and $attrs to _mk_row_parser are seperated to delineate what is
+ # $args and $attrs to _mk_row_parser are separated to delineate what is
# core collapser stuff and what is dbic $rs specific
@{$self->{_row_parser}{$parser_type}}{qw(cref nullcheck)} = $rsrc->_mk_row_parser({
eval => 1,
# can't work without it). Add an explicit check for the *main*
# result, hopefully this will gradually weed out such errors
#
- # FIXME - this is a temporary kludge that reduces perfromance
+ # FIXME - this is a temporary kludge that reduces performance
# It is however necessary for the time being
my ($unrolled_non_null_cols_to_check, $err);
}
-# populate() argumnets went over several incarnations
+# populate() arguments went over several incarnations
# What we ultimately support is AoH
sub _normalize_populate_args {
my ($self, $arg) = @_;
);
}
else {
- # precendence must be given to passed values over values inherited from
+ # precedence must be given to passed values over values inherited from
# the cond, so the order here is important.
my $collapsed_cond = $self->_collapse_cond($self->{cond});
my %implied = %{$self->_remove_alias($collapsed_cond, $alias)};
# determines if the resultset defines at least one
# of the attributes supplied
#
-# used to determine if a subquery is neccessary
+# used to determine if a subquery is necessary
#
# supports some virtual attributes:
# -join
}
# run through the resulting joinstructure (starting from our current slot)
- # and unset collapse if proven unnesessary
+ # and unset collapse if proven unnecessary
#
# also while we are at it find out if the current root source has
# been premultiplied by previous related_source chaining
If an L</order_by> is already declared, and orders the resultset in a way that
makes collapsing as described above impossible (e.g. C<< ORDER BY
has_many_rel.column >> or C<ORDER BY RANDOM()>), DBIC will automatically
-switch to "eager" mode and slurp the entire resultset before consturcting the
+switch to "eager" mode and slurp the entire resultset before constructing the
first object returned by L</next>.
Setting this attribute on a resultset that does not join any has_many
=item dbic_colname
Used to fill in missing sqlt_datatype and sqlt_size attributes (if they are
-explicitly specified they are never overriden). Also used by some weird DBDs,
+explicitly specified they are never overridden). Also used by some weird DBDs,
where the column name should be available at bind_param time (e.g. Oracle).
=back
# Resolves the passed condition to a concrete query fragment and a flag
# indicating whether this is a cross-table condition. Also an optional
-# list of non-triviail values (notmally conditions) returned as a part
+# list of non-trivial values (normally conditions) returned as a part
# of a joinfree condition hash
sub _resolve_condition {
my ($self, $cond, $as, $for, $rel_name) = @_;
# any sort of adjustment/rewrite should be relatively easy (fsvo relatively)
#
sub _mk_row_parser {
- # $args and $attrs are seperated to delineate what is core collapser stuff and
+ # $args and $attrs are separated to delineate what is core collapser stuff and
# what is dbic $rs specific
my ($self, $args, $attrs) = @_;
if $args->{_parent_info}{collapser_reusable};
}
- # Still dont know how to collapse - try to resolve based on our columns (plus already inserted FK bridges)
+ # Still don't know how to collapse - try to resolve based on our columns (plus already inserted FK bridges)
if (
! $collapse_map->{-identifying_columns}
and
# if we got here - we are good to go, but the construction is tricky
# since our children will want to include our collapse criteria - we
# don't give them anything (safe, since they are all collapsible on their own)
- # in addition we record the individual collapse posibilities
+ # in addition we record the individual collapse possibilities
# of all left children node collapsers, and merge them in the rowparser
# coderef later
$collapse_map->{-identifying_columns} = [];
=cut
## It needs to store the new objects somewhere, and call insert on that list later when insert is called on this object. We may need an accessor for these so the user can retrieve them, if just doing ->new().
-## This only works because DBIC doesnt yet care to check whether the new_related objects have been passed all their mandatory columns
+## This only works because DBIC doesn't yet care to check whether the new_related objects have been passed all their mandatory columns
## When doing the later insert, we need to make sure the PKs are set.
## using _relationship_data in new and funky ways..
## check Relationship::CascadeActions and Relationship::Accessor for compat
# What we have been doing forever is hijacking the $order arg of
# SQLA::select to pass in arbitrary pieces of data (first the group_by,
# then pretty much the entire resultset attr-hash, as more and more
-# things in the SQLA space need to have mopre info about the $rs they
+# things in the SQLA space need to have more info about the $rs they
# create SQL for. The alternative would be to keep expanding the
# signature of _select with more and more positional parameters, which
# is just gross. All hail SQLA2!
my $sql = '';
if ($arg->{group_by}) {
- # horible horrible, waiting for refactor
+ # horrible, waiting for refactor
local $self->{select_bind};
if (my $g = $self->_recurse_fields($arg->{group_by}) ) {
$sql .= $self->_sqlcase(' group by ') . $g;
$fin_join = sprintf '( %s ) %s', $fin_join, (shift @j);
}
- # the entire FROM is *ALSO* expected aprenthesized
+ # the entire FROM is *ALSO* expected parenthesized
"( $fin_join )";
}
return wantarray ? ( $sql, @bind ) : $sql;
}
-# we need to add a '=' only when PRIOR is used against a column diretly
+# we need to add a '=' only when PRIOR is used against a column directly
# i.e. when it is invoked by a special_op callback
sub _where_field_PRIOR {
my ($self, $lhs, $op, $rhs) = @_;
}
}
- # still too long - just start cuting proportionally
+ # still too long - just start cutting proportionally
if ($concat_len > $max_trunc) {
my $trim_ratio = $max_trunc / $concat_len;
Clones the schema and its associated result_source objects and returns the
copy. The resulting copy will have the same attributes as the source schema,
-except for those attributes explicitly overriden by the provided C<%attrs>.
+except for those attributes explicitly overridden by the provided C<%attrs>.
=cut
=item *
-Multiple sql files files per upgrade/downgrade/install
+Multiple sql files per upgrade/downgrade/install
=item *
# this is the actual recursing worker
sub _run {
- # warnings here mean I did not anticipate some ueber-complex case
+ # warnings here mean I did not anticipate some uber-complex case
# fatal warnings are not warranted
no warnings;
use warnings;
$storage->ensure_connected;
# if txn_depth is > 1 this means something was done to the
- # original $dbh, otherwise we would not get past the preceeding if()
+ # original $dbh, otherwise we would not get past the preceding if()
$storage->throw_exception(sprintf
'Unexpected transaction depth of %d on freshly connected handle',
$storage->transaction_depth,
# short circuit when we know there is no need for a runner
#
- # FIXME - asumption may be wrong
+ # FIXME - assumption may be wrong
# the rationale for the txn_depth check is that if this block is a part
# of a larger transaction, everything up to that point is screwed anyway
return $self->$run_target($self->_get_dbh, @_)
$self->throw_exception("Can't deploy without a ddl_dir or " . DBIx::Class::Optional::Dependencies->req_missing_for ('deploy') );
}
- # sources needs to be a parser arg, but for simplicty allow at top level
+ # sources needs to be a parser arg, but for simplicity allow at top level
# coming in
$sqltargs->{parser_args}{sources} = delete $sqltargs->{sources}
if exists $sqltargs->{sources};
}
# FIXME This list is an abomination. We need a way to do this outside
-# of the scope of DBIC, as as it is right now nobody will ever think to
+# of the scope of DBIC, as it is right now nobody will ever think to
# even look here to diagnose some sort of misbehavior.
sub _mssql_max_data_type_representation_size_in_bytes {
my $self = shift;
my ($sql, $bind) = $self->next::method (@_);
# If we're using ::NoBindVars, there are no binds by this point so this code
-# gets skippeed.
+# gets skipped.
if ($self->auto_cast && @$bind) {
my $new_sql;
my @sql_part = split /\?/, $sql, scalar @$bind + 1;
=cut
# SET IDENTITY_X only works as part of a statement scope. We can not
-# $dbh->do the $sql and the wrapping set()s individualy. Hence the
+# $dbh->do the $sql and the wrapping set()s individually. Hence the
# sql mangling. The newlines are important.
sub _prep_for_execute {
my $self = shift;
my ($sql, $bind) = $self->next::method (@_);
# SELECT SCOPE_IDENTITY only works within a statement scope. We
- # must try to always use this particular idiom frist, as it is the
+ # must try to always use this particular idiom first, as it is the
# only one that guarantees retrieving the correct id under high
# concurrency. When this fails we will fall back to whatever secondary
# retrieval method is specified in _identity_method, but at this
L<DBIx::Class::Storage::DBI::ACCESS>, see those classes for more
information.
-It is loaded automatically by by L<DBIx::Class::Storage::DBI::ODBC> when it
+It is loaded automatically by L<DBIx::Class::Storage::DBI::ODBC> when it
detects a MS Access back-end.
This driver implements workarounds for C<IMAGE> and C<MEMO> columns, and
=head2 all_storages
-Returns an array of of all the connected storage backends. The first element
-in the returned array is the master, and the remainings are each of the
+Returns an array of all the connected storage backends. The first element
+in the returned array is the master, and the rest are each of the
replicants.
=cut
Based on code originated by:
- Norbert Csongrádi <bert@cpan.org>
- Peter Siklósi <einon@einon.hu>
+ Norbert Csongr�di <bert@cpan.org>
+ Peter Sikl�si <einon@einon.hu>
=head1 LICENSE
that it's easier to break out the auto validation into a role.
This also returns the master in the case that none of the replicants are active
-or just just forgot to create them :)
+or just forgot to create them :)
=cut
described in L<RT#79576|https://rt.cpan.org/Public/Bug/Display.html?id=79576>.
In order to trigger the bug condition one needs to supply B<more than one>
-bind value that is an object with overloaded stringification (nummification
+bind value that is an object with overloaded stringification (numification
is not relevant, only stringification is). When this is the case the internal
DBIx::Class call to C<< $sth->bind_param >> would be executed in a way that
triggers the above-mentioned DBD::SQLite bug. As a result all the logs and
pointing to this section. This warning will be removed 2 years from now,
around April 2015, You can disable it after you've audited your data by
setting the C<DBIC_RT79576_NOWARN> environment variable. Note - the warning
-is emited only once per callsite per process and only when the condition in
-question is encountered. Thus it is very unlikey that your logsystem will be
+is emitted only once per callsite per process and only when the condition in
+question is encountered. Thus it is very unlikely that your logsystem will be
flooded as a result of this.
=back
# keeps the actual file handle open. We don't really want this to happen,
# so force-close the handle via DBI itself
#
- local $@; # so that we do not clober the real error as set above
+ local $@; # so that we do not clobber the real error as set above
eval { $dbh->disconnect }; # if it fails - it fails
undef; # the actual RV of _ping()
}
}
# DBD::SQLite (at least up to version 1.31 has a bug where it will
-# non-fatally nummify a string value bound as an integer, resulting
+# non-fatally numify a string value bound as an integer, resulting
# in insertions of '0' into supposed-to-be-numeric fields
# Since this can result in severe data inconsistency, remove the
-# bind attr if such a sitation is detected
+# bind attr if such a situation is detected
#
# FIXME - when a DBD::SQLite version is released that eventually fixes
-# this sutiation (somehow) - no-op this override once a proper DBD
+# this situation (somehow) - no-op this override once a proper DBD
# version is detected
sub _dbi_attrs_for_bind {
my ($self, $ident, $bind) = @_;
) {
# if none of the multipliers came from an order_by (guaranteed to have been combined
- # with a limit) - easy - just slap a group_by to simulate a collape and be on our way
+ # with a limit) - easy - just slap a group_by to simulate a collapse and be on our way
if (
! $inner_aliastypes->{ordering}
or
# exactly what we expect
# supplement the main selection with pks if not already there,
- # as they will have to be a part of the group_by to colapse
+ # as they will have to be a part of the group_by to collapse
# things properly
my $cur_sel = { map { $_ => 1 } @$inner_select };
# Unfortunately not much can be done until SQLA2 introspection arrives, and even
# then if where conditions apply to the *right* side of the prefetch, you may have
# to both filter the inner select (e.g. to apply a limit) and then have to re-filter
- # the outer select to exclude joins you didin't want in the first place
+ # the outer select to exclude joins you didn't want in the first place
#
# OTOH it can be seen as a plus: <ash> (notes that this query would make a DBA cry ;)
return (\@outer_from, $outer_select, $where, $outer_attrs);
#
# Due to a lack of SQLA2 we fall back to crude scans of all the
# select/where/order/group attributes, in order to determine what
-# aliases are neded to fulfill the query. This information is used
+# aliases are needed to fulfill the query. This information is used
# throughout the code to prune unnecessary JOINs from the queries
# in an attempt to reduce the execution time.
# Although the method is pretty horrific, the worst thing that can
die 'How did we get here...';
}
-# returns an arrayref of column names which *definitely* have som
+# returns an arrayref of column names which *definitely* have some
# sort of non-nullable equality requested in the given condition
# specification. This is used to figure out if a resultset is
# constrained to a column which is part of a unique constraint,
L<create|DBIx::Class::ResultSet/create> sends the original column values
to the database, while L<update|DBIx::Class::ResultSet/update> sends the
encoded values. L<DBIx::Class::UTF8Columns> and L<DBIx::Class::ForceUTF8>
-are both affected by ths bug.
+are both affected by this bug.
It is unclear how this bug went undetected for so long (it was
introduced in March 2006), No attempts to fix it will be made while the
sub store_column {
my ( $self, $column, $value ) = @_;
- # the dirtyness comparison must happen on the non-encoded value
+ # the dirtiness comparison must happen on the non-encoded value
my $copy;
if ( defined $value and $self->_is_utf8_column($column) and utf8::is_utf8($value) ) {
['insert' => 'Insert data into the schema'],
['update' => 'Update data in the schema'],
['delete' => 'Delete data from the schema'],
- ['op:s' => 'compatiblity option all of the above can be suppied as --op=<action>'],
+ ['op:s' => 'compatibility option all of the above can be supplied as --op=<action>'],
['help' => 'display this help', { implies => { schema_class => '__dummy__' } } ],
['documentation-as-pod:s' => 'hidden', { implies => { schema_class => '__dummy__' } } ],
], required => 1 }],
$usage->die();
}
-# option compatability mangle
+# option compatibility mangle
# (can not be joined in the spec, one is s% the other is s)
if($opts->{connect}) {
$opts->{connect_info} = delete $opts->{connect};