NAME

DBIx::DataModel::Meta::Schema - Meta-information about a DBIx::DataModel schema

SYNOPSIS

See synopsis in DBIx::DataModel.

DESCRIPTION

An instance of this class holds meta-information about a DBIx::DataModel schema; so it is called a meta-schema. Within the schema class, the metadm method points to the meta-schema; within the meta-schema instance, the class method points to the associated class. Both are created together: the new() method simultaneously builds a subclass of DBIx::DataModel::Schema, and an instance of DBIx::DataModel::Meta::Schema.

The meta-schema instance contains information about :

  • possible application-specific subclasses of the builtin DBIx::DataModel classes for statements, associations, types, etc.

  • possible overriding of methods at the DBI layer

  • global specifications for columns that should be automatically inserted or updated in every table.

  • lists of tables, types, associations declared within that schema.

  • namespaces for searching for ResultAs classes.

and it contains methods for declaring those meta-objects.

CONSTRUCTOR

new

my $meta_schema = DBIx::DataModel::Meta::Schema->new(%args);

Simultaneously creates a new subclass of DBIx::DataModel::Schema, and an new instance of DBIx::DataModel::Meta::Schema. Arguments are described in the reference documentation.

FRONT-END METHODS FOR DECLARING SCHEMA MEMBERS

Table

$meta_schema->Table($class_name, $db_name, @primary_key, \%options);

View

$meta_schema->View($class_name, $columns, $db_tables, 
                   \%where, @parent_tables);

Association

$meta_schema->Association([$class1, $role1, $multiplicity1, @columns1],
                          [$class2, $role2, $multiplicity2, @columns2]);

Composition

$meta_schema->Composition([$class1, $role1, $multiplicity1, @columns1], 
                          [$class2, $role2, $multiplicity2, @columns2]);

Type

$meta_schema->Type($type_name => 
   $handler_name_1 => sub { ... },
   ...
 );

OTHER PUBLIC METHODS

find_result_class

Called from the DBIx::DataModel::Statement class for finding the class that implements how results from a select() will be returned to the client.

The search for the class walks through names

PRIVATE METHODS

_parse_association_end

Utility methods for parsing both ends of an association declaration.

_parse_join_path

Utility method for parsing arguments to "join", finding the most appropriate source for each path item, retrieving implicit left or inner connectors, and keeping track of aliases.