pg-repository-crud

Community

Structured DAL for multi-tenant PostgreSQL apps.

AuthorPremModhaOfficial
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Go data-access layer that implements a repository pattern for PostgreSQL 18 in a schema-per-tenant environment. It uses a single shared app-database pool (pgxpool) and tenant isolation via search_path, providing a concrete interface and implementation for CRUD, transactions, and a helper to map query results.

Core Features & Use Cases

  • Shared pool per app-database with tenant-scoped access via AcquireForTenant.
  • CRUD operations (Create, FindByID, Update, SoftDelete) with optimistic locking and soft-delete semantics.
  • Transaction management support through WithTransaction to ensure atomic tenant-scoped operations.
  • scanToMaps helper to convert query results into a serializable structure for downstream encoding.

Quick Start

Instantiate the repository with the pool, acquire a tenant-scoped connection, and perform a Create operation.

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-repository-crud
Download link: https://github.com/PremModhaOfficial/motadata-ai-pipeline/archive/main.zip#pg-repository-crud

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.