cakephp / datasources

CakePHP Datasources
http://cakephp.org
237 stars 114 forks source link

SQLite3 view as a model #78

Closed ghost closed 10 years ago

ghost commented 11 years ago

Created by Tyler Hullinger, 12th Jul 2012. (originally Lighthouse ticket #36):


Currently in Datasource/Database/Sqlite.php line #142:

$result = $this->fetchAll("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;", false);

If you would like to use a view as a model you have to tweak the result query to:

$result = $this->fetchAll("SELECT name FROM sqlite_master WHERE type='table' OR type='view' ORDER BY name;", false);

This is a small fix and I had to "hack" it to make it work for my application. I hope you consider to add this fix for other users.

AD7six commented 10 years ago

superseded by #100