On Sunday, February 15, 2015 at 12:58:04 AM UTC-8, Matt Palmer wrote: > > Hi Jeremy, > > On Sat, Feb 14, 2015 at 11:04:46PM -0800, Jeremy Evans wrote: > > Just some minor recommendations: > > Thanks for those, I really appreciate you taking the time to look over the > code. They're all mistakes caused by my lack of familiarity with Sequel's > features, and I'll chip away at all of them over the next little while. > > > 3) Have a different method or add second argument to comment_for to > > indicate column comments. With the current API, you can't differentiate > a > > request for a schema qualified table from a request for a column in a > > table. > > I was wondering about schema-qualified tables. I noticed a few places > where > schemas were mentioned, but couldn't find anything definitive on when > :foo__bar meant "column foo on table bar" or "table bar in schema foo". >
As in SQL, it depends on the context, and Sequel doesn't always know the context. In the case of comment_for, it couldn't know the context, which is why you need a separate method or argument to disambiguate. > > 6) Instead of overriding generator methods to recognize the :comment > > option, override the Database schema methods (e.g. > > Database#create_table_indexes_from_generator, which you are already > > overriding) to check for the :comment option. That would probably > simplify > > things quite a bit. > > I'm not sure what you mean here, but I'll cogitate on it a little and I'm > sure it'll come to me. Basically, in create_table_indexes_from_generator, just examine generator.indexes, generator.columns, and generator.constraints and look for the :comment options, instead of overriding generator methods to recognize them and all handle them roughly the same way. For alter table, you can override apply_alter_table_generator or apply_alter_table to the same effect. Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
