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 TABLE statements 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 --preversion to generate a diff from a previous version.

--install

Install schema version metadata into the database without running DDL. Use --version to specify the version to record.

--select

Select rows from a resultset and print them to stdout. Use --where to filter and --attrs for additional search attributes. Output format is controlled by --format.

--insert

Insert a row into a resultset. Requires --resultset and --set.

--update

Update rows in a resultset. Requires --resultset and --set. Use --where to restrict which rows are affected. Prompts for confirmation unless --force is given.

--delete

Delete rows from a resultset. Requires --resultset. Use --where to restrict which rows are deleted. Prompts for confirmation unless --force is given.

--op=ACTION

Compatibility alias for the action flags above. --op=deploy is 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-stanza to 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 WHERE condition for --select, --update, and --delete, e.g. '{"active":1}'.

--set=JSON

JSON hash of column values for --insert and --update, e.g. '{"name":"Alice"}'.

--attrs=JSON

JSON hash of search attributes (order_by, columns, etc.) for --select and --delete.

DDL Options

--sql-dir=DIR

Directory for reading and writing SQL files. Required for --create; optional for --upgrade and --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, or legacy. auto uses a native driver upgrade path when available and falls back to the legacy DBIO::Schema::Versioned path otherwise. native requires native driver support. legacy requires DBIO::Schema::Versioned.

Output and Misc

--format=FMT

Output format for --select: tsv (tab-separated, default) or csv (requires Text::CSV).

--force

Skip confirmation prompts for destructive operations (--update, --delete, --install with --force).

--trace

Enable DBIO SQL trace output (prints all generated SQL to stderr).

--quiet

Suppress informational output.

-I PATH

Prepend PATH to @INC before loading the schema class. May be given multiple times.

--help

Print a usage summary and exit.

SEE ALSO

DBIO::Admin, dbiogen

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.