Posted by matijs
Sat, 14 Apr 2007 14:42:00 GMT
Setting the stage
Some time ago, I came across SQLDSL, a DSL for building SQL queries. The benefit of using a DSL over plain old string concatenation is that syntax is checked before the database server is hit. Unfortunately, SQLDSL does not deliver. It will happily accept
q = Insert.into["frot"]["zop"]["blob"].values("kng").values["kgn"]
resulting in
q.to_sql
# => "insert into 'frot' (zop) (blob) values ('kng') values () (kgn)"
which is hardly acceptable SQL.
Read more...
Posted in software | Tags dsl, metaprogramming, ruby, sql | no comments | no trackbacks
Posted by matijs
Tue, 10 Apr 2007 22:22:00 GMT
Say you’re an online book store, and you have an affiliate program. Of course, affiliates come and go. So, what do you do when, say, slashdot stops being your affiliate, and someone clicks on an affiliate link left lying around in an old book review? Do you
- Show the book anyway, but not pay the affiliate? Or…
- Tell a potential customer to go elsewhere?
Hmm.
Posted in web | Tags business, stupidity | 1 comment | no trackbacks