Daniel Robbins wrote: > On Mar 15, 2010, at 4:58 PM, Michael Bayer wrote: >> we have some index examples at >> http://www.sqlalchemy.org/docs/metadata.html#indexes . the Index is not >> related to declarative and is specified separately. > > Any plans to improve this? I would have thought that Indexes would be > defined under __table_args__ along with constraints, which are often > related.
the word "improve" here makes me smile. Its the way it is intentionally to look the way table DDL does. We could make the Index construct capable of accepting non-table bound columns in its constructor which would allow you to stick it within your declarative class before the Table is generated...but we're literally talking about allowing a single indent. > > Since Index creation is such a common need, and the current means of > creating one is counter-intuitive, do you think you could add a sample > Index code snippet to the declarative documentation? we definitely should because I am amazed at how often this question gets asked. But the more puzzling thing is that it means the central tenet of declarative isn't getting across to people, which is that nothing changes at all when using declarative, its strictly a syntactical shortcut - everything you do when not using declarative is still 100% doable, in exactly the same way. I'm not sure why I see so many questions from others of the form "but I'm using declarative!" > > -Daniel > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" 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/sqlalchemy?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" 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/sqlalchemy?hl=en.
