Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add using views for SQLite #3

Closed
bashopman opened this issue Nov 3, 2015 · 4 comments
Closed

Add using views for SQLite #3

bashopman opened this issue Nov 3, 2015 · 4 comments

Comments

@bashopman
Copy link

In Queries/Mysql/DbInfo.php method getTables returns both table names and view names, but in Queries/Sqlite/DbInfo.php the same method only returns table names. In order to be able to use views in Sqlite databases, I suggest to change the query used in Queries/Sqlite/DbInfo.php->getTables to:

SELECT name FROM sqlite_master WHERE type="table" OR type="view"

BTW: I like your work for simple-crud!

@oscarotero
Copy link
Owner

Hi, thank you for the suggestion. I didn't know views and sound great.
Looking for information about this, I found that views in sqlite are read-only and in mysql some are updatable, some aren't. So, to support views we need to support also read-only fields (currently all fields are writable). That's not bad, but need a little more work.

@bashopman
Copy link
Author

I have a use-case for read-only views only, so I didn't think about the difference between SQLite and MySQL...
Thanks for your quick response!

@oscarotero
Copy link
Owner

Hi again.
After some thought, I finally released a new version with your suggestion (and other minor changes). There's no read-only support yet (so if you try to save a view, probably you get a PDO exception) but for your use-case is enought.

@bashopman
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants