NAME

dbomb-gen - Generates perl modules for use with DBomb.

DESCRIPTION

dbomb-gen generates Perl code that uses DBomb to bind to a database. dbomb-gen can generate code snippets or an entire directory of Perl modules.

QUICK START

mkdir Foo
dbomb-gen -u john -p xxx --all --pod --gen-modules --split-dir=Foo/ --module-prefix="Foo"  -d db

Now you have a directory of Perl modules, one for each Table in the database. Each module name is prefixed with "Foo::".

OPTIONS

-h,--host HOST        Connect to HOST running server (default: localhost)
-P,--port PORT        Connect to PORT on HOST (default: 3306)
-u,--user USER        Connect as USER (default: '')
-p,--pass PASSWORD    Authenticate with PASSWORD(default: '')
--has-a               Generate `has_a' relationships.
--has-many            Generate `has_many' relationships.
-a,--all              Generate all relationships.
--gen-modules         Generate a complete Perl module for each table.
--pod                 Generate POD.
--module-prefix NAME  Prefix module names with `NAME::'.
--split-dir DIR       Split modules into files in DIR. Implies --gen-modules
--data-source NAME    Used in the generated code (default: '')
-d,--database NAME    Use this database.
-t,--table NAME       Generate only these tables (multiple allowed).
                      If no tables are specified, then generate all tables!

EXAMPLES

# get the minimal code snippet:
dbomb-gen -u john -p xxx  -d db -t tablename

# all modules in one file:
dbomb-gen -u john -p xxx --all --gen-modules -d db  > DBClasses.pm

# build a directory of modules:
dbomb-gen -u john -p xxx --all --pod --gen-modules --split-dir=libdir/ --module-prefix="PRE"  -d db