Skip to content

Instantly share code, notes, and snippets.

@chanmix51
Created November 17, 2014 16:05
Show Gist options
  • Save chanmix51/bbf58ae0621d11dc0c00 to your computer and use it in GitHub Desktop.
Save chanmix51/bbf58ae0621d11dc0c00 to your computer and use it in GitHub Desktop.
blog article about CLI
<?php
use \PommProject\Foundation\Pomm;
$loader = require __DIR__.'/vendor/autoload.php';
return new Pomm(['my_db' =>
[
'dsn' => 'pgsql://user:pass@host:port/db_name'
]
]);
{
"minimum-stability": "dev",
"require": {
"pomm-project/cli": "dev-master"
}
}
$ php vendor/bin/pomm.php inspect:database my_db
Found 5 schemas in database.
+-----------+--------+-----------+------------------------+
| name | oid | relations | comment |
+-----------+--------+-----------+------------------------+
| elcaro | 123773 | 2 | |
| phparchi | 82738 | 1 | |
| pika | 116120 | 1 | |
| public | 2200 | 9 | standard public schema |
| templates | 116119 | 1 | |
+-----------+--------+-----------+------------------------+
$ php vendor/bin/pomm.php generate:schema-all my_db elcaro
✓ Creating file './MyDb/ElcaroSchema/AutoStructure/Department.php'.
✓ Creating file './MyDb/ElcaroSchema/DepartmentModel.php'.
✓ Creating file './MyDb/ElcaroSchema/Department.php'.
✓ Creating file './MyDb/ElcaroSchema/AutoStructure/Employee.php'.
✓ Creating file './MyDb/ElcaroSchema/EmployeeModel.php'.
✓ Creating file './MyDb/ElcaroSchema/Employee.php'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment