Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

fSchema to handle database structure writting..

posted by ilo 9 years ago

While I'm trying to convert NortShoreWebGeek demonstration example as an standalone application I come to the conclusion that supporting different databases through the ORM and Schema but being unable to create a single table or field is confusing. I guess fSchema is the best fit to support schema changes, but this could be very extensive and require a big effort to get easily done. I'm committed to work on this if there is room in fSchema for these writting operations.

Thoughs?

It sounds like you are looking for a normalized way to create tables and columns across different databases? The sole purpose of fSchema is to reflect the schema of the existing database, and it would not be appropriate to lump schema changes in with that.

Currently through fDatabase::translatedQuery() it is possible to use FlourishSql to use a CREATE TABLE query that will work on all supported databases. I have not yet built a normalized form of ALTER TABLE, mostly because there is such a large variation in the different databases, and the simple fact that I have never needed it.

posted by wbond 9 years ago

yes, you are right, that is what I was trying to acomplish. Now I see that fDatabase is the right way to go with this. However I have the feeling that I'm missing something in fSchema. I'll give a try to the table creation using fDatabase::translatedQuery() and drop some ideas about altering operations in the following days.

posted by ilo 9 years ago