NAME

Meta::Db::Def - Object to store a definition for a database.

COPYRIGHT

Copyright (C) 2001, 2002 Mark Veltzer; All rights reserved.

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.

DETAILS

MANIFEST: Def.pm
PROJECT: meta
VERSION: 0.47

SYNOPSIS

package foo;
use Meta::Db::Def qw();
my($dbdef)=Meta::Db::Def->new();
$dbdef->read($file);
my($num_table)=$syntax->num_table();

DESCRIPTION

This is an object to let you read,write and manipulate a database definition.

FUNCTIONS

BEGIN()
new($)
init($)
get_parents($)
set_parents($$)
get_sets($)
set_sets($$)
get_enums($)
set_enums($$)
get_tables($)
set_tables($$)
get_users($)
set_users($$)
print($$)
printd($$)
printx($$)
getsql_create($$$)
getsql_crea($$$)
getsql_drop($$$$)
getsql_clean($$$)
getsql_select($$$)
getsql_insert($$$)
new_file($$)
new_modu($$)
has_table($$)
has_field($$$)
has_parent_table($$)
get_table($$)
get_field($$$)
get_field_number($$$)
add_deps($$$)
TEST($)

FUNCTION DOCUMENTATION

BEGIN()

This method creates the get/set methods for attributes: "name", "description". name - name for this database. description - description of this database.

new($)

Constructor for this class.

init($)

This is an internal post construction tool.

get_parents($)

This will give you the parents object of the current Def.

set_parents($$)

This will set the parents object of the current Def.

get_sets($)

This will give you the sets object of the current Def.

set_sets($$)

This will set the sets object of the current Def.

get_enums($)

This will give you the enums object of the current Def.

set_enums($$)

This will set the enums object of the current Def.

get_tables($)

This will give you the tables object for the current Def.

set_tables($$)

This will set the tables object for the current Def.

get_users($)

This will give you the users object of the current Def.

set_users($$)

This will set the users object of the current Def.

print($$)

This is a routine to printout this def object.

printd($$)

This method will print the def object in docbook format.

printx($$)

This will print the current object in the source XML format.

getsql_create($$$)

This method accepts a Def object and a statement collection and adds to that statement collection all the statements neccessary to create this database in the SQL language.

getsql_crea($$$)

This method accepts Def object and a statement collection and adds to that statement collection all the statements neccessary to create this database in the SQL language.

getsql_drop($$$$)

This method accepts a Def object and a statement collection and adds to that statement collection all the statements neccessary to drop this database in the SQL language.

getsql_clean($$$)

This method accepts a Def object, a statement collection and information about the database that it wants cleaned and adds the statements regarding the cleaning to the statements object.

getsql_select($$$)

This method returns an SQL sniplet which can be used in SELECT type statements.

getsql_insert($$$)

This method returns an SQL sniplet which can be used in INSERT type statements.

new_file($$)

This method receives: 0. A class name. 1. A file to read the def object from. This method returns: 0. A def file constructed from the content of the file. How it does it: The method uses the Meta::Xml::Parsers::Def expat parser to achieve this. Remarks: This method is static.

new_modu($$)

This method receives: 0. A class name. 1. A development module. This method returns: 0. An def object contructed from the content of that development module. How it does it: The method uses the new_file method to achieve this. Remarks: This method is static.

has_table($$)

This method returns a true/false value according to whether you have a certain table or not.

has_field($$$)

This method returns a true/false value according to whether you have a certain table with a certain field in it or not.

has_parent_table($$)

This method returns a true/false value according to whether the object in question has a parent with the table name given.

get_table($$)

This method retrieve a table object (taking care of inheritance too).

get_field($$$)

This method will retrieve a certain field in a certain table.

get_field_number($$$)

This method will return the index number of a field in a table.

add_deps($$$)

This method will add dependency info specific to the XML/DEF format to a dependency storing object.

TEST($)

Test suite for this object. Currently this just reads a def file and prints out the result.

SUPER CLASSES

Meta::Ds::Connected(3)

BUGS

None.

AUTHOR

Name: Mark Veltzer
Email: mailto:veltzer@cpan.org
WWW: http://www.veltzer.org
CPAN id: VELTZER

HISTORY

0.00 MV initial code brought in
0.01 MV bring databases on line
0.02 MV get the databases to work
0.03 MV this time really make the databases work
0.04 MV ok. This is for real
0.05 MV ok - this time I realy mean it
0.06 MV make quality checks on perl code
0.07 MV more perl checks
0.08 MV check that all uses have qw
0.09 MV fix todo items look in pod documentation
0.10 MV more on tests/more checks to perl
0.11 MV fix all tests change
0.12 MV change new methods to have prototypes
0.13 MV perl code quality
0.14 MV more perl quality
0.15 MV more perl quality
0.16 MV perl documentation
0.17 MV get graph stuff going
0.18 MV more perl quality
0.19 MV perl qulity code
0.20 MV more perl code quality
0.21 MV revision change
0.22 MV pictures in docbooks
0.23 MV revision in files
0.24 MV languages.pl test online
0.25 MV db stuff
0.26 MV xml data sets
0.27 MV more data sets
0.28 MV perl packaging
0.29 MV db inheritance
0.30 MV PDMT
0.31 MV tree type organization in databases
0.32 MV some chess work
0.33 MV md5 project
0.34 MV database
0.35 MV perl module versions in files
0.36 MV movies and small fixes
0.37 MV movie stuff
0.38 MV graph visualization
0.39 MV thumbnail user interface
0.40 MV more thumbnail issues
0.41 MV website construction
0.42 MV web site development
0.43 MV web site automation
0.44 MV SEE ALSO section fix
0.45 MV web site development
0.46 MV teachers project
0.47 MV md5 issues

SEE ALSO

Error(3), Meta::Db::Enums(3), Meta::Db::Info(3), Meta::Db::Parents(3), Meta::Db::Sets(3), Meta::Db::Tables(3), Meta::Db::Users(3), Meta::Ds::Connected(3), Meta::Sql::Stat(3), Meta::Xml::Parsers::Def(3), Meta::Xml::Writer(3), XML::DOM(3), strict(3)

TODO

Nothing.