Thanks for the info Jeremy, I'll give it a shot and I suppose I'll find out how 
much I need to modify the result.

On Saturday, October 20, 2012 at 12:44 PM, Jeremy Evans wrote:

> On Saturday, October 20, 2012 6:53:48 AM UTC-7, Sean Mackesey wrote:
> > I'm looking for a script that will either:
> > 
> > (1) generate Sequel model classes with the appropriate associations at 
> > runtime by accessing a database and reading out the tables and foreign key 
> > relations
> > or 
> > (2) generate the code for the above model classes automatically by either 
> > reading a .sql schema file or accessing an existing database.
> > 
> > I know how to write my own script to build the code from a schema file, but 
> > this seems to me like it would useful to enough people that a tool should 
> > already exist.  Anyone know how to do this?
> 
> I don't think it's been done, not because it's difficult, but because it's 
> not as useful as you might think.  A good modelling layer really needs to 
> have input from a user with domain knowledge.  There are some trivial cases 
> where autogenerating models and associations will work well, but I don't 
> think that would be true for databases of significant complexity.  For the 
> trivial cases where it would work well, it wouldn't take much time to write 
> the modelling layer yourself.
> 
> That being said, if this is something that interests you, Sequel provides all 
> of the tools for you to do so (Database#tables, #schema, #foreign_key_list).
> 
> Jeremy 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sequel-talk" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/sequel-talk/-/1iJE1uXzKnEJ.
> To post to this group, send email to [email protected] 
> (mailto:[email protected]).
> To unsubscribe from this group, send email to 
> [email protected] 
> (mailto:[email protected]).
> For more options, visit this group at 
> http://groups.google.com/group/sequel-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" 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/sequel-talk?hl=en.

Reply via email to