A Simple Approach to Comparing Database Structures

On my current project, we are developing a replacement for a legacy system written in Visual FoxPro that our customer has used for the last couple of decades. Since there is a lot of risk in switching over, we have developed a bi-directional syncing tool that attempts to keep each system up-to-date with changes made in the other. Read more on A Simple Approach to Comparing Database Structures…

Mocking React/Apollo Data Tables for UI Development

Recently, I was tasked with creating a new screen containing a table of data for a project using React and Apollo. In the past, we would typically start by defining the database table, other access layers in between that and a GraphQL query schema, and finally the query on the front end using Apollo. This has been quite tedious, and often, we ended up tweaking the schema many times until we ended up with precisely what the front-end UI needed. Read more on Mocking React/Apollo Data Tables for UI Development…

A Case for Learning J

There are few things as humbling as learning a programming language of a radically different paradigm from any you’ve used before. Recently, I’ve been feeling a need to learn a language with which I could easily manipulate data – usually collections of numbers. I thought about learning R or Julia, but while I’m sure those systems are extremely useful, they didn’t seem to offer the chance to have my world rocked and my conception of reality turned upside down. As long as I’m going to learn a language for practical reasons, I might as well learn a Perlis language that will show me (once again) just how much I have to learn about software, so I decided to learn J.

Read more on A Case for Learning J…

Using ActiveRecord to Abstract “Greatest N Per Group” Queries

Some database-related projects require access to information based around maximum and minimum values. Recently, I was trying to figure out the best way to perform a “greatest N per group” query in an ActiveRecord model with a SQL database backend. Eventually, I settled on the SQL proposed by Bill Karwin on StackOverflow. Once I had the SQL, I worked it into a form that fit my needs and moved it into my ActiveRecord model.

My approach allowed me to specify the group based on a set of columns and to abstract the required join logic behind an ActiveRecord scope. The following gist is a complete script that demonstrates the approach.

Read more on Using ActiveRecord to Abstract “Greatest N Per Group” Queries…