The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Meta::Db::Type - Object to store a database type information in it.

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: Type.pm
        PROJECT: meta
        VERSION: 0.49

SYNOPSIS

        package foo;
        use Meta::Db::Type qw();
        my($type)=Meta::Db::Type->new();
        $type->set("String",0,0,0,0);

DESCRIPTION

This is an object to store database type information in it. All types of information are in here.

FUNCTIONS

        BEGIN()
        is_prim($)
        is_inde($)
        is_set($)
        is_enum($)
        print($$)
        printd($$)
        printx($$)
        getsql_create($$$)
        getsql_drop($$$)
        getsql_names($$)
        getsql_bind($$)
        TEST($)

FUNCTION DOCUMENTATION

BEGIN()

This method initializes the module for work. Do not use it directly. The idea is that this module uses translation hashes of types extensivly and we could build them once and use them many times. In addition this method sets up accessor methods for the following attributes: "name", "setref", "enumref", "tableref", "fieldref", "optimized", "null".

is_prim($)

This returns whether the type is a primary key or not for this table.

is_inde($)

This returns whether the type is an index to another table or not.

is_set($)

This returns whether the type is a set type or not.

is_enum($)

This returns whether the type is an enum type or not.

print($$)

This prints out the current type object.

printd($$)

This method prints out the object in DocBook XML format using the a writer object received.

printx($$)

This method prints out the object in XML format using the a writer object received.

getsql_create($$$)

This method will add SQL statements to a container of SQL statements which is recevied which create this type on the database.

getsql_drop($$$)

This method will add SQL statements to a container of SQL statements which is recevied which drop this type on the database.

getsql_names($$)

This method will return an SQL string which describes the type and which is fit for inclusion in an SQL CREATE TABLE type statement.

getsql_bind($$)

This method returns the DBI parameter suitable for inclusion in "bind_param" type DBI statements.

TEST($)

Test suite for this object.

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 ok. This is for real
        0.03 MV make quality checks on perl code
        0.04 MV more perl checks
        0.05 MV check that all uses have qw
        0.06 MV fix todo items look in pod documentation
        0.07 MV more on tests/more checks to perl
        0.08 MV change new methods to have prototypes
        0.09 MV perl code quality
        0.10 MV more perl quality
        0.11 MV more perl quality
        0.12 MV perl documentation
        0.13 MV get graph stuff going
        0.14 MV more perl quality
        0.15 MV perl qulity code
        0.16 MV more perl code quality
        0.17 MV revision change
        0.18 MV languages.pl test online
        0.19 MV history change
        0.20 MV db stuff
        0.21 MV web site stuff
        0.22 MV more data sets
        0.23 MV spelling and papers
        0.24 MV perl packaging
        0.25 MV PDMT
        0.26 MV pictures database
        0.27 MV tree type organization in databases
        0.28 MV some chess work
        0.29 MV more movies
        0.30 MV books XML into database
        0.31 MV md5 project
        0.32 MV database
        0.33 MV perl module versions in files
        0.34 MV movies and small fixes
        0.35 MV movie stuff
        0.36 MV md5 progress
        0.37 MV more Class method generation
        0.38 MV more thumbnail code
        0.39 MV more thumbnail stuff
        0.40 MV thumbnail user interface
        0.41 MV import tests
        0.42 MV more thumbnail issues
        0.43 MV paper writing
        0.44 MV website construction
        0.45 MV web site development
        0.46 MV web site automation
        0.47 MV SEE ALSO section fix
        0.48 MV download scripts
        0.49 MV md5 issues

SEE ALSO

DBI(3), Error(3), Meta::Class::MethodMaker(3), Meta::Ds::Connected(3), strict(3)

TODO

-add auto_increment ?!?

-IpMask and Ip types could limit the size of the text to some limit (12 bytes ? 15 bytes ?)

-make the null attribute a binary value.

-make the print to SGML method write the null and default stuff too (revamp it altogether).

-why is the index created separately ? can't I create it with CREATE TABLE ?