Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
How to generate model from existing tables
  • Hello,

    I used oil to generate the ormauth tables. Am successfully authenticating using the Ormauth driver (no more serialize stuff - yippie).

    I would like to use Model_User for some of my operations. I have tried using the command " oil refine fromdb:model users" to auto generate Model_User but I get the error below;

    Database method Fuel\Core\Database_PDO_Connection::list_indexes is not supported by Fuel\Core\Database_PDO_Connection

    I tried searching through existing posts but did not get a solution. Kindly help.

    Thank you.


  • Don't use the generic PDO driver if a native driver exists, as functions like that are RDBMS specific, and therefore not implemented in the generic driver.

    What database do you use?

    If you use MySQL / MariaDB, use the mysql driver instead. It extends the PDO driver and adds those platform specific functions.

  • Dear Harro,

    I use MySQL / MariaDB. Within my controllers, all db operations are working as expected. oil migrations work fine too.

    In which config file should I specify the mysql driver?
  • In your db.php config file. Use "mysql" instead of "pdo".

    As long as you are using ANSI SQL, the PDO driver works fine, because it is generic SQL. But commands like list columns are RDBMS specific, they can't be implemented generically for all platforms the PHP PDO driver supports.

    So there are specific PDO extensions tor MySQL, MSSQL, Oracle, etc.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion