It is a first package deployed via my channel pear.kuziel.info.
It provides commands for two PEAR libraries. DB DatabObject and MDB2 Schema.
Installation
Here's the real example of what the help text of my (Very Lite) PEAR Channel Frontend Serendipity plugin says.
To discover my channel and install this package run:
pear channel-dicover pear.kuziel.info
pear install kuziel/Kuziel_PEAR_Command_Database
DB DataObject: dbdo-create-table
This command is replacement for original createTables.php from DB DataObject package.
It generates DB DatabObject classes and database (schema) ini file for given DB DatabObject configuration ini file.
For more information about the configuration have a look at DB DataObject Configuration Options documentation.
Run it:
pear dbdo-create-tables /full/path/to/your/your-dbdo.ini
or, in case you're located in the same directory where your DB DataObject ini file is, run:
pear dbdo-create-tables your-dbdo.ini
If you like shortcuts, you can use 'ddct' as a shortcut for 'dbdo-create-tables'. So, the previous example can also look like:
pear ddct your-dbdo.ini
MDB2 Schema
There are two commands available for MDB2 Schema package, only command 'mdb2-create-schema' is working at the moment. There is also second command 'mdb2-update-schema' available, however, it is not implemented yet.
MDB2 Schema: mdb2-create-schema
This command creates MDB2 Schema (xml) file for given database.
If you run it like this:
pear mdb2-create-schema pgsql://username:password@host/database
Where, of course, 'pgsql://username:password@host/database' is replaced with your real DSN, command will create database.xml file with structure and data dump of your database.
Shortcut for the command 'mdb2-create-schema' is 'mdb2cs'. So previous example would look like:
pear mdb2cs pgsql://username:password@host/database
Note: MDB2 Schema package has some issues with table names (, or more precisely with underscores in your table names), so this command may fail if you don't have "correct" table names.
Help information
For more information about the commands run:
pear help dbdo-create-tables
pear help mdb2-create-schema
Note: At the moment Kuziel_PEAR_Command_Database package has its dependencies set for DB DataObject and MDB2 Schema only as optional, not required. It's because you may want to use only DB DataObject, or only MDB2 Schema command. If it is not obvious, you have to have those packages installed if you want to use their commands
.