You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kat is a lightweight, powerful CLI tool for PostgreSQL database migrations. It allows you to manage your database schema using SQL files with a simple, intuitive workflow.
-[Comparison with Other Tools](#comparison-with-other-tools)
17
+
-[Architecture Overview](#architecture-overview)
18
+
-[Go Library Usage](#go-library-usage)
19
+
-[Best Practices](#best-practices)
20
+
-[Limitations](#limitations)
21
+
-[Quick Reference](#quick-reference)
22
+
-[Documentation](#documentation)
23
+
24
+
</details>
25
+
26
+
Kat is (probably?) the first open-source PostgreSQL migration tool that treats your schema as a Directed Acyclic Graph, not a linear log. It enables topological sort migrations with explicit dependencies, parallel development workflows, and deterministic ordering.
9
27
10
28

11
29
@@ -23,6 +41,29 @@ Kat is a lightweight, powerful CLI tool for PostgreSQL database migrations. It a
23
41
-**Custom Logger Support**: Configure custom logging for migrations
24
42
-**Go Library**: Use Kat programmatically in your Go applications
25
43
44
+
## Why Graph-Based Migrations?
45
+
46
+
Traditional migration tools force you into a linear sequence where every developer must coordinate their schema changes. Kat's graph-based approach solves this by allowing migrations to declare explicit parent dependencies, creating a Directed Acyclic Graph (DAG) that determines execution order.
47
+
48
+
**Benefits of the DAG approach:**
49
+
-**Parallel Development**: Multiple developers can create feature migrations simultaneously without conflicts
50
+
-**Deterministic Ordering**: Kat computes the optimal execution order based on dependencies, not timestamps
51
+
-**Safe Branching**: Feature branches can include their own migrations that merge cleanly
52
+
-**Complex Dependencies**: A migration can depend on multiple parents, enabling sophisticated schema evolution
53
+
54
+
```text
55
+
Linear (traditional): Graph-based (Kat):
56
+
57
+
001_users 001_users ──┬─→ 003_posts
58
+
002_posts │
59
+
003_add_email 002_add_email ──┘
60
+
61
+
Order: 1→2→3 Order: 1→2→3 OR 1→3→2
62
+
(rigid) (flexible, dependency-aware)
63
+
```
64
+
65
+
This means you can create migrations for different features in parallel, and Kat will figure out the correct order when you run `kat up`.
66
+
26
67
## Installation
27
68
28
69
### Quick Install (macOS & Linux)
@@ -50,29 +91,65 @@ For more installation options, see the [installation documentation](https://kat.
50
91
51
92
## Quick Start
52
93
94
+
Here's a realistic example showing how Kat's graph-based system handles parallel development:
95
+
53
96
```bash
54
97
# Initialize a new Kat project
55
98
kat init
56
99
57
-
# Create a new migration
100
+
# Create foundation migration
58
101
kat add create_users_table
59
102
60
-
# Create another migration with a parent dependency
➡️ *Need help?* Visit [GitHub Discussions](https://github.com/BolajiOlajide/kat/discussions) for questions and [GitHub Issues](https://github.com/BolajiOlajide/kat/issues) for bug reports.
324
+
175
325
## Documentation
176
326
177
-
Visit the [Kat documentation site](https://kat.bolaji.de/) for detailed guides on:
327
+
Visit the [Kat documentation site](https://kat.bolaji.de/) for detailed guides:
0 commit comments