# pau4o/sqitch architecture

> Architecture diagram of the GitHub repository pau4o/sqitch, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pau4o/sqitch
- Repository: https://github.com/pau4o/sqitch

## Overview

Sqitch is a standalone database change-management application. Users define database-native change scripts and a plan with dependencies; Sqitch uses that plan to order changes and deploy them to a supported database engine, maintaining deployment integrity. The tree shows command, plan, target, configuration, and engine modules, but no source excerpts were provided, so internal calls and finer command relationships cannot be verified. The README documents the plan/script/deployment relationships and supported engines.

Main entry points: [`lib/App/Sqitch/Engine.pm`](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Engine.pm) (Engine interface), [`lib/App/Sqitch/Plan.pm`](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Plan.pm) (Change plan), [`lib/App/Sqitch/Command/deploy.pm`](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Command/deploy.pm) (Deploy command), [`lib/App/Sqitch/Target.pm`](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Target.pm) (Database target)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command interface"]
  node_commands["Sqitch commands<br/>[Command.pm]"]
  node_deploy["Deploy command<br/>[deploy.pm]"]
  node_revert["Revert command<br/>[revert.pm]"]
  node_verify["Verify command<br/>[verify.pm]"]
end

subgraph group_planning["Change planning"]
  node_plan["Change plan<br/>[Plan.pm]"]
  node_changes["Plan changes<br/>[Change.pm]"]
  node_dependencies["Dependencies<br/>[Depend.pm]"]
  node_native_scripts["Native scripts"]
end

subgraph group_execution["Deployment engines"]
  node_engine_api["Engine interface<br/>[Engine.pm]"]
  node_pg_engine["PostgreSQL engine<br/>[pg.pm]"]
  node_mysql_engine["MySQL engine<br/>[mysql.pm]"]
  node_sqlite_engine["SQLite engine<br/>[sqlite.pm]"]
  node_other_engines["Other engines"]
end

subgraph group_state["Project and state"]
  node_target["Database target<br/>[Target.pm]"]
  node_config["Configuration<br/>[Config.pm]"]
end

node_user(("Project user"))
node_database[("Database")]

node_user -->|"runs"| node_commands
node_user -->|"writes"| node_native_scripts
node_user -->|"defines"| node_plan
node_plan -->|"declares"| node_dependencies
node_plan -->|"orders"| node_changes
node_deploy -->|"uses"| node_plan
node_deploy -->|"deploys through"| node_engine_api
node_engine_api -->|"executes"| node_native_scripts
node_engine_api -->|"connects to"| node_target
node_target -->|"selects"| node_database
node_engine_api -->|"supports"| node_pg_engine
node_engine_api -->|"supports"| node_mysql_engine
node_engine_api -->|"supports"| node_sqlite_engine
node_engine_api -->|"supports"| node_other_engines
node_user -.->|"configures"| node_config
node_revert -.->|"reverts through"| node_engine_api
node_verify -.->|"verifies through"| node_engine_api

click node_commands "https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Command.pm"
click node_deploy "https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Command/deploy.pm"
click node_revert "https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Command/revert.pm"
click node_verify "https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Command/verify.pm"
click node_plan "https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Plan.pm"
click node_changes "https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Plan/Change.pm"
click node_dependencies "https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Plan/Depend.pm"
click node_engine_api "https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Engine.pm"
click node_pg_engine "https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Engine/pg.pm"
click node_mysql_engine "https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Engine/mysql.pm"
click node_sqlite_engine "https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Engine/sqlite.pm"
click node_other_engines "https://github.com/pau4o/sqitch/tree/develop/lib/App/Sqitch/Engine"
click node_target "https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Target.pm"
click node_config "https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Config.pm"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_commands,node_deploy,node_revert,node_verify,node_user toneBlue
class node_plan,node_changes,node_dependencies,node_native_scripts,node_database toneAmber
class node_engine_api,node_pg_engine,node_mysql_engine,node_sqlite_engine,node_other_engines toneMint
class node_target,node_config toneRose
```

## Components

### Command interface

- [Sqitch commands](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Command.pm): `lib/App/Sqitch/Command.pm`
- [Deploy command](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Command/deploy.pm): `lib/App/Sqitch/Command/deploy.pm`
- [Revert command](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Command/revert.pm): `lib/App/Sqitch/Command/revert.pm`
- [Verify command](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Command/verify.pm): `lib/App/Sqitch/Command/verify.pm`

### Change planning

- [Change plan](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Plan.pm): `lib/App/Sqitch/Plan.pm`
- [Plan changes](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Plan/Change.pm): `lib/App/Sqitch/Plan/Change.pm`
- [Dependencies](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Plan/Depend.pm): `lib/App/Sqitch/Plan/Depend.pm`
- **Native scripts**

### Deployment engines

- [Engine interface](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Engine.pm): `lib/App/Sqitch/Engine.pm`
- [PostgreSQL engine](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Engine/pg.pm): `lib/App/Sqitch/Engine/pg.pm`
- [MySQL engine](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Engine/mysql.pm): `lib/App/Sqitch/Engine/mysql.pm`
- [SQLite engine](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Engine/sqlite.pm): `lib/App/Sqitch/Engine/sqlite.pm`
- [Other engines](https://github.com/pau4o/sqitch/tree/develop/lib/App/Sqitch/Engine): `lib/App/Sqitch/Engine`

### Project and state

- [Database target](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Target.pm): `lib/App/Sqitch/Target.pm`
- [Configuration](https://github.com/pau4o/sqitch/blob/develop/lib/App/Sqitch/Config.pm): `lib/App/Sqitch/Config.pm`

### Other components

- **Project user**
- **Database**

## Connections

- Project user → Sqitch commands: runs (evidence: `README.md`)
- Project user → Native scripts: writes (evidence: `README.md`)
- Project user → Change plan: defines (evidence: `README.md`)
- Change plan → Dependencies: declares (evidence: `README.md`)
- Change plan → Plan changes: orders (evidence: `README.md`)
- Deploy command → Change plan: uses (evidence: `README.md`)
- Deploy command → Engine interface: deploys through (evidence: `README.md`)
- Engine interface → Native scripts: executes (evidence: `README.md`)
- Engine interface → Database target: connects to (evidence: `README.md`)
- Database target → Database: selects (evidence: `README.md`)
- Engine interface → PostgreSQL engine: supports (evidence: `README.md`)
- Engine interface → MySQL engine: supports (evidence: `README.md`)
- Engine interface → SQLite engine: supports (evidence: `README.md`)
- Engine interface → Other engines: supports (evidence: `README.md`)
- Project user → Configuration: configures
- Revert command → Engine interface: reverts through
- Verify command → Engine interface: verifies through
