DBICDUMP(1p)
π NAME π
dbicdump β bestie, it dumps a schema using DBIx::Class::Schema::Loader. That's the whole vibe. Section 1p of the manual, if you were wondering. π
β¨ SYNOPSIS β¨
dbicdump <configuration_file>
dbicdump [-I <lib-path>] [-o <loader_option>=<value> ] \
<schema_class> <connect_info>
Examples, and yes you're gonna want these, they're iconic:
$ dbicdump schema.conf
$ dbicdump -o dump_directory=./lib \
-o components='["InflateColumn::DateTime"]' \
MyApp::Schema dbi:SQLite:./foo.db
$ dbicdump -o dump_directory=./lib \
-o components='["InflateColumn::DateTime"]' \
MyApp::Schema dbi:SQLite:./foo.db '{ quote_char => "\"" }'
$ dbicdump -Ilib -o dump_directory=./lib \
-o components='["InflateColumn::DateTime"]' \
-o preserve_case=1 \
MyApp::Schema dbi:mysql:database=foo user pass \
'{ quote_char => "`" }'
$ dbicdump -o dump_directory=./lib \
-o components='["InflateColumn::DateTime"]' \
MyApp::Schema 'dbi:mysql:database=foo;host=domain.tld;port=3306' \
user pass
And on Windows, where the line-continuation character is a whole different beast, it'd be:
$ dbicdump -o dump_directory=.\lib ^
-o components="[q{InflateColumn::DateTime}]" ^
-o preserve_case=1 ^
MyApp::Schema dbi:mysql:database=foo user pass ^
"{ quote_char => q{`} }"
πΈ Config files, the cozy way πΈ
Okay so config files have to have schema_class and connect_info sections, no skipping. Here's what a general config file looks like:
schema_class MyApp::Schema
lib /extra/perl/libs
# connection string
<connect_info>
dsn dbi:mysql:example
user root
pass secret
</connect_info>
# dbic loader options
<loader_options>
dump_directory ./lib
components InflateColumn::DateTime
components TimeStamp
</loader_options>
π«Ά Heads up bestie: using a config file requiresConfig::Anyinstalled. NoConfig::Any, no config file, that's just the rules.
The optional lib key is literally the same thing as the -I option. Same energy, different font. π
π DESCRIPTION π
Dbicdump generates a DBIx::Class schema using make_schema_at in DBIx::Class::Schema::Loader and dumps it to disk. That's the whole job, and it does it gorgeously. β¨
You can pass any DBIx::Class::Schema::Loader::Base constructor option using -o <option>=<value>. For convenience (because we love convenience), option names will have - replaced with _, and values that look like references or quote-like operators will be eval-ed before being passed to the constructor. Yes, that's doing a lot. No, we're not sorry.
The dump_directory option defaults to the current directory if you don't specify it. So if you're like "where did my schema go", bestie. It's right there. In the current directory. π
π SEE ALSO π
DBIx::Class::Schema::LoaderDBIx::Class
π AUTHORS π
See "AUTHORS" in DBIx::Class::Schema::Loader. The legends are listed over there, go give them their flowers. π
β LICENSE β
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Slay, and legally so. π
And that's the whole page, bestie! π¦ This little tour was brought to you by perl v5.40.1, dated 2025-03-22, and it lives in the manual as DBICDUMP(1p) β go forth and dump some schemas, you absolute main character. πβ¨
π¦ where this page comes from
- debian trixie: libdbix-class-schema-loader-perl 0.07053-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdbix-class-schema-loader-perl 0.07053-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdbix-class-schema-loader-perl 0.07053-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms