> I am trying solve 2 problems. > > 1. DB Neutral schema > 2. Build schema by picking tables from multiple places. For example, > you may want to include session table from web.py in your schema. > > Probably, the first problem can be solved if we pick a translator. > What about the second. > How should the session table be represented in web.session. It is too > ugly to say, the schema for session table is available in some > docstring, take that and add to your schema.sql.
No, presumably the translator would also include a script that would execute the schema commands in the DB and you would call it on the schema module and on your DB module. There's no reason the CREATE TABLE commands have to be grouped together. The one real benefit I can see from having table definitions in Python, as opposed to SQL, is that Python can actually analyze the structure of tables. If you're doing rapid development it's very painful to keep database tables in sync. It would be wonderful if web.py could see that a schema had changed an automatically issue the appropriate ALTER TABLE statements to bring the local DB up to date. Rails solves this using Migrations: http://wiki.rubyonrails.org/rails/pages/UnderstandingMigrations If web.py had something similar it would be a real improvement over things now. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/webpy?hl=en -~----------~----~----~----~------~----~------~--~---
