pg-crossjoin-worker

Community

Cross-join data with bounded worker pools.

AuthorPremModhaOfficial
Version1.0.0
Installs0

System Documentation

What problem does it solve?

App-layer cross-join resolution for the platform's schema-per-tenant PostgreSQL 18 data access layer. SQL-level JOINs across entities are forbidden. When a QueryStruct specifies cross_join entities (e.g. user, asset), the primary query runs first, then reference IDs are collected and resolved in parallel via a BOUNDED worker-pool goroutine pattern. Covers: EntityResolver interface, ResolveCrossJoins() with worker pool, ID collection per entity, result merging back into primary rows, and the appendCrossJoinColumns() helper. Unbounded goroutines (one per row or per ID) are strictly forbidden.

SCOPE: DAL SERVICE ONLY — These patterns run INSIDE the data-access-layer service. Entity services NEVER use pgxpool, AcquireForTenant, or execute SQL directly. Entity services use the /dal-service-patterns skill to communicate with DAL via NATS. If you are implementing an entity service (identity, incident-core, etc.), STOP and use /dal-service-patterns instead.

When to Activate

  • Implementing cross-entity data resolution after a primary SQL query
  • Building or reviewing any worker-pool pattern for parallel data fetching
  • Extending QueryStruct execution with new joinable entity types

Used by: database-architect, code-generator (DAL service only)


Core Features & Use Cases

  • App-layer cross-join resolution using a bounded worker pool to fetch related entities.
  • Merges fetched records into primary rows as "entity.field" keys.
  • Enforces no SQL JOINs across entities; uses dot-qualified output columns for cross-join fields.

Quick Start

Run the cross-join workflow to resolve referenced records in parallel and merge them into the primary result.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: pg-crossjoin-worker
Download link: https://github.com/PremModhaOfficial/motadata-ai-pipeline/archive/main.zip#pg-crossjoin-worker

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.