I wrote my first SQL statements today. I haven’t gotten as far as actually inserting data yet – they just create the tables as described here. But it’s a start, and I also started doing the modifications to the code to dump the data to the database. I’m definitely past my programmers’ block now: I have lots of small steps ahead of me, and I’ll even try to work on it some midweek if I can tear myself away from my blog reading/writing.

I’ve decided to stick with Michael Feathers’ dictum to avoid database access in your unit tests; it turned out to be easy enough to throw in a thin SQL-free layer that is forcing me to do most of the necessary code modifications. So I’m happy enough with the parts of the code that actually add entries to the database being only tested via acceptance tests. (The code to create the tables is written by hand, invoked by a shell script, so no Java at all there.)

As I created the tables, and compared them with, say, the SQL dumps of the database backing up the blog, I realized that I don’t know anything about indexing. Something to think about, though it’s not necessarily urgent unless I run into performance problems. Which I doubt I will for quite some time.

Post Revisions: