NAME
dbioadmin - CLI for DBIO schema administration
VERSION
version 0.900000
SYNOPSIS
dbioadmin --schema-class=MyApp::Schema \
--connect='["dbi:Pg:dbname=myapp","user","pass",{}]' \
--deploy
dbioadmin --schema-class=MyApp::Schema \
--connect='["dbi:Pg:dbname=myapp","user","pass",{}]' \
--upgrade
dbioadmin --schema-class=MyApp::Schema \
--connect='["dbi:Pg:dbname=myapp","user","pass",{}]' \
--create --sql-dir=./sql --sql-type=PostgreSQL
dbioadmin --schema-class=MyApp::Schema \
--connect='["dbi:Pg:dbname=myapp","user","pass",{}]' \
--select --resultset=User --where='{"active":1}'
dbioadmin --schema-class=MyApp::Schema \
--connect='["dbi:Pg:dbname=myapp","user","pass",{}]' \
--insert --resultset=User --set='{"name":"Alice","email":"alice@example.com"}'
dbioadmin --schema-class=MyApp::Schema \
--connect='["dbi:Pg:dbname=myapp","user","pass",{}]' \
--delete --resultset=User --where='{"active":0}' --force
DESCRIPTION
dbioadmin is the CLI frontend for DBIO::Admin. It connects to a database using a DBIO schema class and performs administrative operations: DDL generation, schema deployment and upgrade, and basic data manipulation.
For programmatic use, see DBIO::Admin.
OPTIONS
Actions
Exactly one action must be specified per invocation.
- --deploy
-
Deploy the schema to the database. Runs
CREATE TABLEstatements for all result sources defined in the schema class. - --upgrade
-
Upgrade the database to the current schema version. The upgrade strategy is controlled by
--mode. - --create
-
Generate DDL files (and optionally diff files) into
--sql-dir. Requires--sql-dir. Pass--preversionto generate a diff from a previous version. - --install
-
Install schema version metadata into the database without running DDL. Use
--versionto specify the version to record. - --select
-
Select rows from a resultset and print them to stdout. Use
--whereto filter and--attrsfor additional search attributes. Output format is controlled by--format. - --insert
-
Insert a row into a resultset. Requires
--resultsetand--set. - --update
-
Update rows in a resultset. Requires
--resultsetand--set. Use--whereto restrict which rows are affected. Prompts for confirmation unless--forceis given. - --delete
-
Delete rows from a resultset. Requires
--resultset. Use--whereto restrict which rows are deleted. Prompts for confirmation unless--forceis given. - --op=ACTION
-
Compatibility alias for the action flags above.
--op=deployis equivalent to--deploy.
Connection
- --schema-class=CLASS (required)
-
The DBIO schema class to load, e.g.
MyApp::Schema. - --schema=CLASS
-
Alias for
--schema-class. - --connect=JSON
-
Connection info as a JSON array, e.g.
'["dbi:Pg:dbname=myapp","user","pass",{}]'. The four elements are DSN, username, password, and DBI attributes. - --connect-info key=value
-
Connection info as individual key-value pairs. Pass multiple times:
--connect-info dsn=dbi:Pg:dbname=myapp --connect-info user=me. - --config=FILE
-
Config file parseable by Config::Any (YAML, JSON, etc.). Used together with
--config-stanzato locate connection info. - --config-stanza=PATH
-
Path within the config file to the connection info, using
::as separator, e.g.Model::DB.
Schema and Resultset
- --resultset=CLASS
-
Resultset (source name) to operate on for
--select,--insert,--update, and--delete, e.g.User. - --class=CLASS
-
Alias for
--resultset. - --where=JSON
-
JSON hash used as the
WHEREcondition for--select,--update, and--delete, e.g.'{"active":1}'. - --set=JSON
-
JSON hash of column values for
--insertand--update, e.g.'{"name":"Alice"}'. - --attrs=JSON
-
JSON hash of search attributes (
order_by,columns, etc.) for--selectand--delete.
DDL Options
- --sql-dir=DIR
-
Directory for reading and writing SQL files. Required for
--create; optional for--upgradeand--deploy. - --sql-type=TYPE
-
SQL translator type for
--create, e.g.PostgreSQL,MySQL,SQLite. - --version=VERSION
-
Version string to record when using
--install. - --preversion=VERSION
-
Previous version when generating a diff with
--create. - --mode=MODE
-
Upgrade strategy. One of
auto(default),native, orlegacy.autouses a native driver upgrade path when available and falls back to the legacyDBIO::Schema::Versionedpath otherwise.nativerequires native driver support.legacyrequiresDBIO::Schema::Versioned.
Output and Misc
- --format=FMT
-
Output format for
--select:tsv(tab-separated, default) orcsv(requires Text::CSV). - --force
-
Skip confirmation prompts for destructive operations (
--update,--delete,--installwith--force). - --trace
-
Enable DBIO SQL trace output (prints all generated SQL to stderr).
- --quiet
-
Suppress informational output.
- -I PATH
-
Prepend
PATHto@INCbefore loading the schema class. May be given multiple times. - --help
-
Print a usage summary and exit.
SEE ALSO
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.