database-driver-design

Design Swift database client libraries with wire protocols and connection pooling.

Updated Mar 20, 2026
One-click install
npx skills add https://github.com/mihai-chiorean/inc --skill database-driver-design-mihai-chiorean
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-driver-design
Source: https://github.com/mihai-chiorean/inc/tree/main/skills/database-driver-design
Command: npx skills add https://github.com/mihai-chiorean/inc --skill database-driver-design-mihai-chiorean

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the complexity of building robust, high-performance database client libraries in Swift by providing standardized patterns for wire protocols, connection management, and concurrency.

Core Features & Use Cases

  • Protocol Implementation: Guidance on building state machines and length-prefixed binary encoding for wire protocols.
  • Safety & Concurrency: Best practices for preventing SQL injection via string interpolation and aligning actors with NIO event loops.
  • Use Case: Use this skill when designing a new database driver to ensure your implementation handles backpressure, connection pooling, and type-safe query execution correctly.

Quick Start

Ask the database-driver-design skill to review your current connection state machine implementation for potential concurrency issues.

Frequently Asked Questions about database-driver-design

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

FAQPage Schema
How do I design a wire protocol state machine for a Swift database driver?

Designing a wire protocol state machine requires structuring length-prefixed binary encoding and defining connection state transitions. This skill provides architectural patterns to map protocol flows and review connection state machines for potential concurrency issues.

What's the best way to prevent SQL injection when building a Swift database client?

Preventing SQL injection in Swift database clients involves avoiding raw string interpolation and enforcing type-safe query APIs. This skill outlines best practices for parameterized queries and type safety to eliminate injection vulnerabilities.

How does Swift Concurrency integrate with NIO event loops for database drivers?

Integrating Swift Concurrency with NIO involves aligning actors with NIO event loops to manage execution safely. This skill provides architectural patterns to ensure your driver handles concurrency without event loop blocking.

How do I manage backpressure and connection pooling in a Swift database driver?

Managing backpressure and connection pooling requires architectural patterns for flow control and resource allocation. This skill covers implementation strategies to handle high-throughput scenarios and maintain driver stability.

Can I use SwiftNIO to build a production-grade database client from scratch?

Using SwiftNIO to build a production-grade database client is supported through NIO-aligned actor execution and binary encoding patterns. This skill offers the necessary architectural guidance for high-performance client libraries.

Why does my Swift database driver lose connections under high concurrency?

Losing connections under high concurrency often results from mismanaged connection pooling or event loop blocking. This skill helps review your connection state machine implementation to identify and resolve these concurrency issues.