database

Automate PostgreSQL database operations with EF Core migrations, indexing, and transactions.

Updated Jan 23, 2026
One-click install
npx skills add https://github.com/jnPiyush/AI-Squad --skill database-jnpiyush
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database
Source: https://github.com/jnPiyush/AI-Squad/tree/main/ai_squad/skills/database
Command: npx skills add https://github.com/jnPiyush/AI-Squad --skill database-jnpiyush

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a structured approach to managing PostgreSQL databases in .NET projects using Entity Framework Core, migrations, and robust transaction handling. It helps teams maintain schema evolution, optimize queries, and ensure reliable connections in production workloads.

Core Features & Use Cases

  • EF Core setup with PostgreSQL provider and retry strategies.
  • Migrations and scripts for safe schema evolution.
  • Indexing strategies and performance optimization.
  • Transactions for multi-step operations with rollback safety.
  • Connection pooling and resource management for scalable apps.
  • Repository pattern and best practices for data access.

Quick Start

dotnet new console -n DemoApp cd DemoApp dotnet add package Npgsql.EntityFrameworkCore.PostgreSQL dotnet ef migrations add InitialCreate dotnet ef database update dotnet ef migrations script --output migration.sql // Example project scaffold and commands to bootstrap the workflow.

Frequently Asked Questions about database

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate PostgreSQL migrations using EF Core?

PostgreSQL migrations with EF Core are automated using 'dotnet ef migrations add' to scaffold schema changes and 'dotnet ef database update' to apply them. You can also generate migration SQL scripts for controlled deployment.

What is the best way to handle transactions in PostgreSQL with EF Core?

Transactions in PostgreSQL with EF Core are handled using explicit transaction patterns for multi-step operations. This approach ensures rollback safety and robust data integrity if any step fails during complex data modifications.

How do I configure connection pooling for PostgreSQL in a .NET app?

Connection pooling for PostgreSQL is configured through the Npgsql provider settings in your EF Core setup. Proper configuration manages database connections efficiently, ensuring scalable apps and reliable connections under production workloads.

When do I need to add indexes for query optimization in PostgreSQL?

You need to add indexes for query optimization in PostgreSQL when schema evolution introduces slow queries. Applying index best practices and concrete indexing strategies optimizes query performance for production database workloads.

Can I use the repository pattern with EF Core and PostgreSQL?

Yes, you can use the repository pattern with EF Core and PostgreSQL. This Skill provides repository pattern implementations and data access best practices to structure your data layer reliably.

Why does my EF Core PostgreSQL connection need retry strategies?

Your EF Core PostgreSQL connection needs retry strategies to handle transient connection failures in production workloads. Configuring retry strategies during EF Core setup ensures robust and reliable database connections.