basic sqlx relation scanning

Very quick, I wanted to use Get with a query that contained other tables. The documentation does not have a lot of examples so here we go. Given the following database schema CREATE EXTENSION pgcrypto; CREATE TABLE content_types ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), name VARCHAR(255), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, deleted_at TIMESTAMP DEFAULT NULL ); CREATE TABLE content ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), content_type_id UUID REFERENCES content_types(id) ON DELETE CASCADE ON UPDATE CASCADE, content TEXT, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, deleted_at TIMESTAMP DEFAULT NULL ) I want to query and return a content row with its content_type, here is the struct I want to return....

December 7, 2015

Getting Started with Gorilla MUX

This is going to be short and sweet. I have been looking at getting into Go for awhile but lacked incentive. That has, as of a week ago, changed and it’s full speed ahead. For this I will be using Gorilla MUX. If you haven’t taken a look at the Gorilla toolkit yet I highly recommend it. I really enjoy using it, the use as individual components really resonates with me and my style of coding....

April 19, 2014