fuel / oil

Fuel PHP Framework - Fuel v1.x Oil command-line package
http://fuelphp.com/docs/packages/oil/intro.html
106 stars 67 forks source link

Generate Scaffold based on Database #103

Closed dbpolito closed 11 years ago

dbpolito commented 12 years ago

Would be great if we have a way to generate scaffold based on created database tables instead of create it all from oil then we can use a DB Design Tool.

oil g scaffold users --from-table (get the fields on users table and generate the files)

Does it make sense for someone else?

WanWizard commented 12 years ago

At the moment that would only be possible for MySQL, as the current database layer does not support the required functionality for other platforms.

Having said that, +1 :)

codeho commented 12 years ago

yep, my +1 stands here as well :)

Erocanti commented 12 years ago

+1

WanWizard commented 12 years ago

It should be possible to implement now, as the PDO driver now has list_columns() implemented.

frankdejonge commented 12 years ago

I'd say, code it up and request a pull :)

dbpolito commented 12 years ago

Great... i'm going to start working on it. :D

douglao commented 12 years ago

+1

evanrolfe commented 11 years ago

+2

kenjis commented 11 years ago

There is an implementation of my friend.

See https://github.com/mp-php/fuel-myapp/blob/master/tasks/scafdb.php

WanWizard commented 11 years ago

To be usable it would need an ORM implementation too. And it needs a check to see if list_columns() doesn't throw exceptions and returns something useful.

mamor commented 11 years ago

This task is calling the standard method of FuelPHP. https://github.com/fuel/oil/issues/103#issuecomment-10261672

Model_Crud will be generated if '--crud' option is given. ORM is generated if no option is given.

Since some corrections were made, please see. https://github.com/mp-php/fuel-myapp/blob/master/tasks/scafdb.php

mamor commented 11 years ago

Thank you :)