mysql-expert

Design portable relational schemas and queries for MySQL 8+ within PHP APIs.

2|Updated Feb 28, 2024
One-click install
npx skills add https://github.com/coagus/php-api-builder --skill mysql-expert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mysql-expert
Source: https://github.com/coagus/php-api-builder/tree/main/.claude/skills/mysql-expert
Command: npx skills add https://github.com/coagus/php-api-builder --skill mysql-expert

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The MySQL expert skill helps architects and developers design robust, portable relational schemas and write efficient queries across MySQL, PostgreSQL, and SQLite within the php-api-builder ecosystem.

Core Features & Use Cases

  • Schema design guidance for tables, keys, and indexes to optimize performance and portability.
  • Migration strategy and best practices for additive changes across multiple DB engines.
  • PDO-oriented query patterns and transaction handling for reliable data access.
  • Cross-driver considerations (MySQL vs PostgreSQL vs SQLite) with concrete examples.

Quick Start

Analyze your current schema and draft a portable 3-5 table design with corresponding migrations.

Frequently Asked Questions about mysql-expert

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

FAQPage Schema
How do I design a portable MySQL schema that works across PostgreSQL and SQLite?

To design a portable MySQL schema, you must apply cross-driver patterns for data types, indexing, and JSON handling that minimize drift across MySQL, PostgreSQL, and SQLite. This ensures your relational schema maintains consistent behavior across different database engines within PHP APIs.

What's the best way to handle database migrations for additive changes across multiple DB engines?

The best way to handle database migrations across multiple DB engines is to implement additive migration strategies that avoid breaking changes. This approach ensures portable schema evolution across MySQL, PostgreSQL, and SQLite by using compatible data type mappings and index creation patterns.

How do I write safe transactions and queries using PDO in PHP APIs?

Writing safe transactions with PDO requires enforcing PDO-based access patterns and secure transaction handling for reliable data access. This method ensures atomic database operations and prevents partial updates when executing relational queries within your PHP API architecture.

Does this MySQL schema design approach support MySQL 8+ JSON handling and indexing?

Yes, this approach fully supports MySQL 8+ JSON handling and indexing by applying performance-focused design patterns. It provides concrete cross-driver examples for managing JSON data structures while ensuring compatibility with PostgreSQL and SQLite equivalents.

How do I optimize MySQL indexing and schema design for high-performance PHP APIs?

Optimizing MySQL indexing for PHP APIs involves applying performance-focused design principles to table structures, keys, and indexes. This process minimizes cross-driver drift and ensures efficient query execution across relational database schemas.

What are the limitations of using portable patterns for cross-driver database queries?

Portable cross-driver database patterns limit the use of proprietary MySQL 8+ features and engine-specific optimizations to maintain compatibility. You must carefully manage charset considerations and avoid driver-specific syntax to prevent drift across PostgreSQL and SQLite environments.