DBIx::Class::CDBICompat - Class::DBI Compatibility layer.
package My::CDBI;
use base qw/DBIx::Class::CDBICompat/;
...continue as Class::DBI...
DBIx::Class features a fully featured compatibility layer with Class::DBI and some common plugins to ease transition for existing CDBI users.
This is not a wrapper or subclass of DBIx::Class but rather a series of plugins. The result being that even though you're using the Class::DBI emulation layer you are still getting DBIx::Class objects. You can use all DBIx::Class features and methods via CDBICompat. This allows you to take advantage of DBIx::Class features without having to rewrite your CDBI code.
CDBICompat is good enough that many CDBI plugins will work with CDBICompat, but many of the plugin features are better done with DBIx::Class methods.
search_where() is fully emulated using DBIC's search. Aside from emulation there's no reason to use search_where().
nocache is fully emulated.
The features of CDBI::Sweet are better done using DBIC methods which are almost exactly the same. It even uses Data::Page.
This plugin will work, but it is more efficiently done using DBIC's native search facilities. The major difference is that DBIC will not infer the join for you, you have to tell it the join tables.
In fact, this class is just a receipe containing all the features emulated. If you like, you can choose which features to emulate by building your own class and loading it like this:
package My::DB;
__PACKAGE__->load_own_components(qw/CDBICompat/);
this will automatically load the features included in My::DB::CDBICompat, provided it looks something like this:
package My::DB::CDBICompat;
__PACKAGE__->load_components(qw/
CDBICompat::ColumnGroups
CDBICompat::Retrieve
CDBICompat::HasA
CDBICompat::HasMany
CDBICompat::MightHave
/);
add_constraint, constrain_column
delete, insert, store_column, update
make_read_only
clear_object_index, inflate_result, nocache, purge_dead_from_object_index, remove_from_object_index
&34;&34; overloading, stringify_self
DESTROY
add_constructor, search_Retrieve, sql_Retrieve
accessor_name_for, mk_group_accessors, mutator_name_for, new
add_columns, find_column, get_column, get_inflated_column, has_a, has_many, set_column, set_inflated_column, store_inflated_column
meta_info, might_have, search
copy
create, discard_changes, resultset_instance
autoupdate
get_temp, has_real_column, set, set_temp
get
construct, count_all, find_or_create, maximum_value_of, minimum_value_of, retrieve, retrieve_all, retrieve_from_sql
page, pager
all_columns, columns, primary_column
search_where
connection, db_Main, set_sql, sth_to_objects, transform_sql
mk_classdata
has_one
belongs_to
many_to_many
add_relationship_accessor, register_relationship
proxy_to_related
count_related, create_related, delete_related, find_or_create_related, find_or_new_related, find_related, new_related, related_resultset, search_related, search_related_rs, set_from_related, update_from_related, update_or_create_related
inflate_column
sequence
ID, id, ident_condition
MULTICREATE_DEBUG, get_columns, get_dirty_columns, get_from_storage, get_inflated_columns, has_column_loaded, in_storage, insert_or_update, is_changed, is_column_changed, make_column_dirty, register_column, result_source, set_columns, set_inflated_columns, throw_exception, update_or_insert
table
add_column, add_relationship, add_unique_constraint, column_info, column_info_from_storage, get_inherited_ro_instance, has_column, iterator_class, primary_columns, relationship_info, relationships, remove_column, remove_columns, result_class, resultset_attributes, resultset_class, set_inherited_ro_instance, set_primary_key, source_info, unique_constraint_columns, unique_constraint_names, unique_constraints
dbi_commit, dbi_rollback, resolve_class, result_source_instance, setup_schema_instance, storage, txn_begin, txn_commit, txn_do, txn_rollback
count, count_literal, find, find_or_new, search_like, search_literal, update_or_create
MODIFY_CODE_ATTRIBUTES, component_base_class, mk_classaccessor
inject_base, load_optional_class
ensure_class_found, ensure_class_loaded, load_components, load_optional_components, load_own_components
get_component_class, get_inherited, get_simple, get_super_paths, make_group_accessor, make_group_ro_accessor, make_group_wo_accessor, mk_group_ro_accessors, mk_group_wo_accessors, set_component_class, set_inherited, set_simple
The following methods and classes are not emulated, maybe in the future.
Deprecated in Class::DBI.
Not documented in Class::DBI. CDBICompat's columns() returns a plain string, not an object.
Undocumented CDBI method.
The following elements of Class::DBI have limited support.
The semi-documented Class::DBI::Relationship objects returned by meta_info($type, $col) are mostly emulated except for their args method.
Relationships between tables (has_a, has_many...) must be delcared after all tables in the relationship have been declared. Thus the usual CDBI idiom of declaring columns and relationships for each class together will not work. They must instead be done like so:
package Foo;
use base qw(Class::DBI);
Foo->table("foo");
Foo->columns( All => qw(this that bar) );
package Bar;
use base qw(Class::DBI);
Bar->table("bar");
Bar->columns( All => qw(up down) );
# Now that Foo and Bar are declared it is safe to declare a
# relationship between them
Foo->has_a( bar => "Bar" );
Matt S. Trout <mst@shadowcatsystems.co.uk>
You may distribute this code under the same terms as Perl itself.
Last modified:
POD_DERIVED_INDEX_GENERATED The following documentation is automatically generated. Please do not edit this file, but rather the original, inline with DBIx::Class::CDBICompat at blib/lib/DBIx/Class/CDBICompat.pm (on the system that originally ran this). If you do edit this file, and don't want your changes to be removed, make sure you change the first line.