MySQL Database

Configure MySQL/MariaDB connections and data mappings in FreePascal/Lazarus with SQLdb/Zeos.

17|7|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/delphicleancode/lazarus-spec-kit --skill mysql-database
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: MySQL Database
Source: https://github.com/delphicleancode/lazarus-spec-kit/tree/main/.gemini/skills/mysql-database
Command: npx skills add https://github.com/delphicleancode/lazarus-spec-kit --skill mysql-database

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill consolidates best practices for developing with MySQL and MariaDB in FreePascal/Lazarus using SQLdb/Zeos, covering connection setup, data typing, JSON usage, triggers, stored procedures, replication, and migration scripting.

Core Features & Use Cases

  • Connection management: reliable SQLdb/Zeos connections to MySQL/MariaDB servers with sane defaults.
  • Data mapping: mapping MySQL types to FreePascal types (ftInteger, ftString, ftJSON, etc) and practical code patterns.
  • Advanced features: JSON storage, triggers, procedures, functions, and upsert patterns (ON DUPLICATE KEY UPDATE).
  • Migrations & DevOps: schema migrations and versioned scripts for repeatable deployments, including InnoDB defaults and UTF8MB4 usage.
  • Guidance & examples: templates and examples for repositories, transactions, error handling and basic security practices.

Quick Start

Configure the MySQL connection via SQLdb/Zeos and create a simple table to validate end-to-end integration.

Frequently Asked Questions about MySQL Database

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

FAQPage Schema
How do I connect a Lazarus FreePascal application to a MySQL database using Zeos or SQLdb?

Connect Lazarus to MySQL by configuring SQLdb or Zeos components with server credentials and sane defaults. This establishes robust database access patterns for reliable connection management and transactional integrity in FreePascal applications.

What is the correct way to map MySQL data types to FreePascal field types like ftInteger and ftString?

Mapping MySQL data types to FreePascal involves translating database columns to native types like ftInteger, ftString, and ftJSON. This ensures accurate data representation when retrieving or storing records via SQLdb or Zeos components.

Can I handle JSON storage and upsert patterns with MariaDB in Lazarus?

JSON storage and upsert patterns with MariaDB are fully supported in Lazarus. You can implement ON DUPLICATE KEY UPDATE operations, handle ftJSON fields, and utilize triggers, stored procedures, and functions for advanced database logic.

What's the best way to manage MySQL schema migrations and versioned scripts for Lazarus projects?

Manage MySQL schema migrations by applying versioned scripts for repeatable deployments. This approach enforces InnoDB defaults and UTF8MB4 usage, ensuring consistent database structures across development and production environments.

Does this approach support transactional integrity and error handling for MariaDB connections?

Transactional integrity and error handling are core supported features for MariaDB connections. It provides repository templates and security practices to manage transactions safely and handle connection errors within FreePascal.