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....