NAME

dbiogen - Dump a database schema to DBIO Result classes

VERSION

version 0.900004

SYNOPSIS

dbiogen <schema_class> <dsn> <user> <password> [options]

# Classic style (default)
dbiogen My::Schema dbi:Pg:dbname=foo myuser mypassword

# Cake style (most concise)
dbiogen --style=cake My::Schema dbi:Pg:dbname=foo myuser mypassword

# Candy style
dbiogen --style=candy My::Schema dbi:Pg:dbname=foo myuser mypassword

# With extra options
dbiogen --style=cake \
         -o dump_directory=./lib \
         -o debug=1 \
         My::Schema \
         dbi:Pg:dbname=foo \
         myuser mypassword

DESCRIPTION

dbiogen connects to a database, introspects the schema, and generates DBIO Result class files using DBIO::Generate.

Styles

vanilla (default)

Traditional use base 'DBIO::Core' with __PACKAGE__-add_columns(...)> method calls.

cake

Uses use DBIO::Cake with DDL-like DSL: col name => varchar(100);

candy

Uses use DBIO::Candy with has_column name => data_type => 'varchar', size => 100;

moose

Uses use Moose with extends instead of use base.

Options are given as -o key=value pairs. Any option valid for DBIO::Generate can be passed this way.

OPTIONS

--style=STYLE

Generated code style. One of vanilla (default), cake, candy, or moose. See "DESCRIPTION" above for a description of each style.

--password-env=VAR

The password is the value of the environment variable VAR; the password argument is left out. A password given as an argument stands in the argument list, which ps and the shell history show: give it by --password-env or --password-stdin.

--password-stdin

The password is the first line of STDIN; on a terminal it is asked for without echo. Not together with --password-env.

-o key=value

Pass an option directly to DBIO::Generate. May be given multiple times. Values that look like JSON objects or arrays are decoded automatically. Numeric values are coerced to numbers. Examples:

-o dump_directory=./lib
-o debug=1
-o components=["DBIO::InflateColumn::DateTime"]

Any option accepted by DBIO::Generate may be set this way.

-o introspect_class=CLASS

Force a specific introspector class instead of the one dbiogen would pick itself. By default it uses the installed driver's introspector when there is one -- DBIO::MySQL::Introspect for a dbi:mysql: DSN, DBIO::SQLite::Introspect for dbi:SQLite:, and so on -- falling back to the generic DBIO::Introspect::DBI when the driver distribution is not installed. The class in use is printed unless -o quiet=1 is given.

SEE ALSO

DBIO::Generate, DBIO::Introspect::Base, dbioadmin

AUTHOR

DBIO & DBIx::Class Authors

COPYRIGHT AND LICENSE

Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.