> I have been working on the inner bits of boss_db of late, you may have seen > a lot of commits come across that project. However I really want to change > the way that Models work. The current version relies on a lot of "Magic" in > the form of parse transforms. I dislike this for several reasons.
> The transform code is a very hard to work with > It makes it much harder to understand what your code is doing > It creates a bunch of functions that have no source code, so they are hard > to understand > it does not feel very "erlangish" in style. +1 to that. The trick is to replace them with something that is still fairly easy to use, and perhaps make it more flexible too (and, as they say, I'd like a pony, while we're at it:-) One of the things I love about Ruby is how easy it is with Rails to string together some fairly complex DB queries. You can actually do quite a bit before you have to give up and just run raw SQL queries. > What I am proposing is that we change models to be a behavior, to create a > model you would just create a model that implemented the gen_model behavior > and specify how things work via a record. > > You can take a look at what I am thinking in this gist: > > https://gist.github.com/zkessin/8686881 > > I look forward to your comments. Kind of random thoughts in no particular order: I don't care about running on all kinds of databases. Postgres is a must, SQLite would be nice to have, maybe Mysql. I do stuff like this all the time in Rails: Student.where("students.age > 30").include(:exams).map { |s| [s.name, s.exams.map(&:grade)] } So support for more complex queries, joins, things like that would be wonderful. Here's another kind of query I'd like to run without resorting to SQL: select students.id, students.name, count(exams.id) as examnum from students join exams on (exams.student_id = students.id) group by students.id, students.name. -- David N. Welton http://www.welton.it/davidw/ http://www.dedasys.com/ -- You received this message because you are subscribed to the Google Groups "ChicagoBoss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at http://groups.google.com/group/chicagoboss. To view this discussion on the web visit https://groups.google.com/d/msgid/chicagoboss/CA%2Bb9R_vFWjEYUVgrbiygYXHrLn-ozX2gt0NePvZH%2BxgoMGSERw%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
