=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:
Use L<DBIx::Class::Row/discard_changes>.
- $row->discard_changes
+ $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
the Row.
# will return the scalar reference:
- $row->somecolumn()
+ $result->somecolumn()
# issue a select using the PK to re-fetch the row data:
- $row->discard_changes();
+ $result->discard_changes();
# Now returns the correct new value:
- $row->somecolumn()
+ $result->somecolumn()
To update and refresh at once, chain your calls:
- $row->update({ 'somecolumn' => { -ident => 'othercolumn' } })->discard_changes;
+ $result->update({ 'somecolumn' => { -ident => 'othercolumn' } })->discard_changes;
=item .. store JSON/YAML in a column and have it deflate/inflate automatically?
__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 $row;
+ my $result;
- # assume that somewhere in here $row will get assigned to a MyTable row
+ # assume that somewhere in here $result will get assigned to a MyTable row
- $row->non_column_data('some string'); # would set the non_column_data accessor
+ $result->non_column_data('some string'); # would set the non_column_data accessor
# some other stuff happens here
- $row->update(); # would not inline the non_column_data accessor into the update
+ $result->update(); # would not inline the non_column_data accessor into the update
=item How do I use DBIx::Class objects in my TT templates?