News for hackers. Stuff that matters.
Re:Why I Hate Frameworks by dools on Wednesday July 20, 2011 @10:02PM (#2788226)
Wait'll you see the project I'm about to open source ;)
Re:Why I Hate Frameworks by rjbond3rd on Wednesday July 20, 2011 @11:31PM (#2788421)
Give us a hint.
Re:Why I Hate Frameworks by dools on Thursday July 21, 2011 @12:33AM (#2788529)
I'll go you one better! I figured I may as well chuck this on github now - I've been stalling for weeks until I got the time to update it to use PDO/parametrized queries by default but I've just put a large warning at the top of the README that it's pre-release:

https://github.com/iaindooley/Anorm

The ORM for SQL lovers!

That's only half the story: I've done the "query reader". Hopefully we can all come up with the ultimate "query builder" together - but the basic principle is that the query reader and query builder should be kept completely separate with SQL as their interface.

I also need to come up with a neat way using closures to "mix-in" functionality to the "query row" objects (that take the place of the normal "boiler plate" DbObject type classes (usually "one per table" kind of deal).

What do y'all reckon? Email [email protected] or fork the project - would love to hear everyone's opinions.

Re:Why I Hate Frameworks by wvenable on Thursday July 21, 2011 @02:32AM (#2788697)
I like this. I looked at the code but I couldn't find how it gets the table name corresponding to the columns in order to populate the correct objects. The mysql interface has mysql_field_table() but that doesn't exist in mysqli or PDO.
Re:Why I Hate Frameworks by dools on Thursday July 21, 2011 @02:45AM (#2788717)
Hi there, I'm not 100% sure what you mean here but I would love to continue the discussion - feel free to email me: [email protected]
Re:Why I Hate Frameworks by dools on Thursday July 21, 2011 @02:00AM (#2788653)
In reply to alnayyir:

"Well, if it were Python and not PHP, you'd have a customer. :)"

This from the README:

Anorm is implemented here using PHP, however it was so easy to build (only took me an hour to write the actual code) that I would encourage others to use a similar pattern and implement it in other languages.

Fork and enjoy! I'd love to see this same pattern implemented in a bunch of different languages

Re:Why I Hate Frameworks by eropple on Thursday July 21, 2011 @01:13AM (#2788596)
I hate to be that guy, but Anorm is already the name of the Play! Scala ORM. Might want to consider a rename. =)
Re:Why I Hate Frameworks by dools on Thursday July 21, 2011 @01:25AM (#2788613)
Haha no shit! That's hilarious. Anorm was a typo last year in November when I was first talking to my friend about it on IRC. I meant to type "an orm" - maybe someone else made the same mistake ;)

Thanks for the heads up! (name suggestions welcome :)

Re:Why I Hate Frameworks by eropple on Thursday July 21, 2011 @11:00AM (#2789769)
Clearly the answer is:

Abnorm.

Re:Why I Hate Frameworks by iaskwhy on Thursday July 21, 2011 @04:30AM (#2788862)
Nanorm?
Re:Why I Hate Frameworks by minikomi on Thursday July 21, 2011 @07:20AM (#2789096)
anotherorm ?
Re:Why I Hate Frameworks by alnayyir on Thursday July 21, 2011 @01:57AM (#2788648)
Well, if it were Python and not PHP, you'd have a customer. :)

Any excuse to get away from SQLAlchemy is a good one in my book.