Toxic Elephant

A DSL for making SQL-like DSLs

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  | Tags , , ,  | no comments | no trackbacks

Who told you to come to this book store?

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

  1. Show the book anyway, but not pay the affiliate? Or…
  2. Tell a potential customer to go elsewhere?

Hmm.

Posted in  | Tags ,  | 1 comment | no trackbacks

Toxic Elephant is Matijs van Zuijlen's weblog.

Powered

Categories

Archives