Databases

Access DuckDB, MySQL, PostgreSQL, SQL Server, and DBISAM in C# with typed queries.

6|Updated Oct 27, 2025
One-click install
npx skills add https://github.com/lawless-m/claude-skills --skill databases
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Databases
Source: https://github.com/lawless-m/claude-skills/tree/main/Databases
Command: npx skills add https://github.com/lawless-m/claude-skills --skill databases

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires Npgsql, MySql.Data, and includes references (resource) components.

What problem does it solve?

This Skill simplifies complex relational database management system (RDBMS) interactions in C#, providing proven patterns for various databases and drivers. It eliminates the guesswork and boilerplate code for connecting, querying, and mapping data, ensuring consistent and efficient database operations.

Core Features & Use Cases

  • Multi-Database Support: Access DuckDB, MySQL, PostgreSQL, SQL Server, and DBISAM using ODBC or native drivers.
  • Type-Safe Data Mapping: Utilize the ExecuteAndMap pattern for reliable C# object mapping from query results.
  • PostgreSQL Array Handling: Seamlessly manage array parameters for native PostgreSQL queries.
  • Use Case: Quickly set up a C# application to extract sales data from a legacy SQL Server database, transform it, and load it into a modern PostgreSQL data warehouse, all while handling different connection types and data structures.

Quick Start

Use the Databases skill to help me connect to a PostgreSQL database and execute a query with array parameters.

Frequently Asked Questions about Databases

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

FAQPage Schema
How do I connect to PostgreSQL, MySQL, or SQL Server from C# and execute queries safely?

Use parameterized queries with native or ODBC drivers to connect reliably across PostgreSQL, MySQL, SQL Server, DuckDB, and DBISAM. The ExecuteAndMap pattern enforces using statements, handles timeouts, and ensures type-safe result mapping while preventing SQL injection and resource leaks.

Can I work with PostgreSQL arrays as query parameters in C#?

Yes. PostgreSQL array parameters are seamlessly managed through native driver support, allowing you to pass and retrieve array data structures directly in parameterized queries without manual serialization.

What's the best way to map database query results to C# objects?

The ExecuteAndMap pattern provides type-safe, reliable mapping from result sets to C# objects. It handles null-safety, enforces resource management, and works consistently across all supported databases—PostgreSQL, MySQL, SQL Server, DuckDB, and DBISAM.

Does this approach work with legacy SQL Server databases and modern PostgreSQL?

Yes. The Skill supports cross-DBMS connectivity, making it suitable for scenarios that require extracting data from legacy SQL Server and loading into PostgreSQL or other modern databases while handling different connection types and data structures.

Can I use ODBC drivers instead of native database drivers?

Yes. Both native and ODBC parameter styles are supported, giving you flexibility to use ODBC drivers for databases like DBISAM or to standardize on ODBC across your C# application regardless of the underlying database.

How do I handle database timeouts and null values reliably?

The ExecuteAndMap pattern includes built-in timeout handling and null-safety mechanisms that enforce defensive coding practices through using statements and parameterized queries, protecting against connection leaks and unexpected null references.