Abstracting SQL schema with closures (www.reddit.com)