NAME
dbs_update - Update SQL Databases
DESCRIPTION
dbs_update is an utility to update SQL databases from text files.
FORMAT OF THE TEXT FILES
dbs_update assumes that each line of the input contains a data record and that the field within the records are separated by tabulators. The first field of the data record is used as table name.
Alternatively dbs_update can read the column names from the first line of input (see the -h/--headline option).
COMMAND LINE PARAMETERS
Required command line parameters are the DBI driver (Pg
for Postgres or mysql
for MySQL) and the database name. The third parameter is optionally and specifies the database user and/or the host where the database resides (racke
, racke@linuxia.net
or @linuxia.net
).
OPTIONS
-f FILE, --file=FILE
Reads records from file FILE instead of from standard input.
-h, --headline
Reads the column names from the first line of the input instead of dedicting them from the database layout. Requires the -t/--table option.
-t TABLE, --table=TABLE
Uses TABLE as table name for all records instead of the first field name.
-r ROUTINE, --routine=ROUTINE
Applies ROUTINE to any data record. ROUTINE must be a subroutine. dbs_update passes the table name and a hash reference to this subroutine. The keys of the hash are the column names and the values are the corresponding field values.
AUTHOR
Stefan Hornburg, racke@linuxia.net
SEE ALSO
perl(1), DBIx::Easy(3)