Skip to content


F# SchemaRunner

A couple years ago I wrote a database utility for work that allowed us to update our development databases to a specific version. The idea is simple.  We have a special database table to keep track of the last run script. We call this special table SchemaInfo, and it contains exactly one column: VersionNumber. Whenever the database needs to be updated we write a change script with the version number incremented by one from the previous script. The only requirement is that the last statement of each change script needs to update the VersionNumber in SchemaInfo table. The name of the change script starts with the version number to allow the scripts to be sorted sequentially. This database versioning idea was originally borrowed from Rails 1.

I called this utility SchemaRunner. It was originally written in C# to match our code base.

Original C# version.

Click to enlarge. Original C# version.

Earlier this year I decided to play around with F#, so I figured the best way to learn it is to actually use it.  I’ll be rewriting SchemaRunner using F#.  I’ll be posting bits and pieces while I’m doing the rewrite.  When I’m finished I’ll make the source code freely available.  Maybe people will find the tool useful in their development environment.  Most important of all, this can serve as an example for anyone who wants to learn about F#.

Time to hack!

Posted in F#, SchemaRunner. Tagged with , , .

One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Continuing the Discussion

  1. schema_runner is on github - Left Right Fold linked to this post on March 31, 2009

    [...] the previous post I mentioned that I wanted to learn F# by rewriting a database utility that I oringinally [...]

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.