Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dbix::class::utf8columns(3) [osx man page]

DBIx::Class::UTF8Columns(3)				User Contributed Perl Documentation			       DBIx::Class::UTF8Columns(3)

NAME
DBIx::Class::UTF8Columns - Force UTF8 (Unicode) flag on columns (DEPRECATED) SYNOPSIS
package Artist; use base 'DBIx::Class::Core'; __PACKAGE__->load_components(qw/UTF8Columns/); __PACKAGE__->utf8_columns(qw/name description/); # then belows return strings with utf8 flag $artist->name; $artist->get_column('description'); DESCRIPTION
This module allows you to get and store utf8 (unicode) column data in a database that does not natively support unicode. It ensures that column data is correctly serialised as a byte stream when stored and de-serialised to unicode strings on retrieval. THE USE OF THIS MODULE (AND ITS COUSIN DBIx::Class::ForceUTF8) IS VERY STRONGLY DISCOURAGED, PLEASE READ THE WARNINGS BELOW FOR AN EXPLANATION. If you want to continue using this module and do not want to receive further warnings set the environment variable "DBIC_UTF8COLUMNS_OK" to a true value. Warning - Module does not function properly on create/insert Recently (April 2010) a bug was found deep in the core of DBIx::Class which affects any component attempting to perform encoding/decoding by overloading store_column and get_columns. As a result of this problem create sends the original column values to the database, while update sends the encoded values. DBIx::Class::UTF8Columns and DBIx::Class::ForceUTF8 are both affected by ths 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 implications of changing such a fundamental behavior of DBIx::Class are being evaluated. However in this day and age you should not be using this module anyway as Unicode is properly supported by all major database engines, as explained below. If you have specific questions about the integrity of your data in light of this development - please join us on IRC or the mailing list to further discuss your concerns with the team. Warning - Native Database Unicode Support If your database natively supports Unicode (as does SQLite with the "sqlite_unicode" connect flag, MySQL with "mysql_enable_utf8" connect flag or Postgres with the "pg_enable_utf8" connect flag), then this component should not be used, and will corrupt unicode data in a subtle and unexpected manner. It is far better to do Unicode support within the database if possible rather than converting data to and from raw bytes on every database round trip. Warning - Component Overloading Note that this module overloads "store_column" in DBIx::Class::Row in a way that may prevent other components overloading the same method from working correctly. This component must be the last one before DBIx::Class::Row (which is provided by DBIx::Class::Core). DBIx::Class will detect such incorrect component order and issue an appropriate warning, advising which components need to be loaded differently. SEE ALSO
Template::Stash::ForceUTF8, DBIx::Class::UUIDColumns. METHODS
utf8_columns EXTENDED METHODS
get_column get_columns store_column AUTHORS
See "CONTRIBUTORS" in DBIx::Class. LICENSE
You may distribute this code under the same terms as Perl itself. perl v5.16.2 2012-08-16 DBIx::Class::UTF8Columns(3)

Check Out this Related Man Page

DBIx::Class::Manual::Component(3)			User Contributed Perl Documentation			 DBIx::Class::Manual::Component(3)

NAME
DBIx::Class::Manual::Component - Developing DBIx::Class Components WHAT IS A COMPONENT
A component is a module that can be added in to your DBIx::Class classes to provide extra functionality. A good example is the PK::Auto component which automatically retrieves primary keys that the database itself creates, after the insert has happened. USING
Components are loaded using the load_components() method within your DBIx::Class classes. package My::Thing; use base qw( DBIx::Class::Core ); __PACKAGE__->load_components(qw/InflateColumn::DateTime TimeStamp/); Generally you do not want to specify the full package name of a component, instead take off the DBIx::Class:: part of it and just include the rest. If you do want to load a component outside of the normal namespace you can do so by prepending the component name with a +. __PACKAGE__->load_components(qw/ +My::Component /); Once a component is loaded all of it's methods, or otherwise, that it provides will be available in your class. The order in which is you load the components may be very important, depending on the component. If you are not sure, then read the docs for the components you are using and see if they mention anything about the order in which you should load them. CREATING COMPONENTS
Making your own component is very easy. package DBIx::Class::MyComp; use base qw(DBIx::Class); # Create methods, accessors, load other components, etc. 1; When a component is loaded it is included in the calling class' inheritance chain using Class::C3. As well as providing custom utility methods, a component may also override methods provided by other core components, like DBIx::Class::Row and others. For example, you could override the insert and delete methods. sub insert { my $self = shift; # Do stuff with $self, like set default values. return $self->next::method( @_ ); } sub delete { my $self = shift; # Do stuff with $self. return $self->next::method( @_ ); } Now, the order that a component is loaded is very important. Components that are loaded first are the first ones in the inheritance stack. So, if you override insert() but the DBIx::Class::Row component is loaded first then your insert() will never be called, since the DBIx::Class::Row insert() will be called first. If you are unsure as to why a given method is not being called try printing out the current linearized MRO. print join ', ' => mro::get_linear_isa('YourClass::Name'); EXISTING COMPONENTS
Extra These components provide extra functionality beyond basic functionality that you can't live without. DBIx::Class::CDBICompat - Class::DBI Compatibility layer. DBIx::Class::FormTools - Build forms with multiple interconnected objects. DBIx::Class::HTMLWidget - Like FromForm but with DBIx::Class and HTML::Widget. DBIx::Class::Ordered - Modify the position of objects in an ordered list. DBIx::Class::PK::Auto - Retrieve automatically created primary keys upon insert. DBIx::Class::QueriesTime - Display the amount of time it takes to run queries. DBIx::Class::RandomStringColumns - Declare virtual columns that return random strings. DBIx::Class::UUIDColumns - Implicit UUID columns. DBIx::Class::WebForm - CRUD methods. Experimental These components are under development, their interfaces may change, they may not work, etc. So, use them if you want, but be warned. DBIx::Class::Validation - Validate all data before submitting to your database. Core These are the components that all, or nearly all, people will use without even knowing it. These components provide most of DBIx::Class' functionality. DBIx::Class::Core - Loads various components that "most people" would want. DBIx::Class::AccessorGroup - Lets you build groups of accessors. DBIx::Class::DB - Non-recommended classdata schema component. DBIx::Class::InflateColumn - Automatically create objects from column data. DBIx::Class::PK - This class contains methods for handling primary keys and methods depending on them. DBIx::Class::Relationship - Inter-table relationships. DBIx::Class::ResultSourceProxy::Table - Provides a classdata table object and method proxies. DBIx::Class::Row - Basic row methods. SEE ALSO
DBIx::Class::Manual::Cookbook AUTHOR
Aran Clary Deltac <bluefeet@cpan.org> perl v5.16.2 2012-08-16 DBIx::Class::Manual::Component(3)
Man Page