From 4cdccde9cf7e5e844df48d5ddf148f55321f8e43 Mon Sep 17 00:00:00 2001 From: Hein Date: Sat, 7 Feb 2026 09:59:35 +0200 Subject: [PATCH] docs: update CLAUDE.md with additional utilities and supported formats --- CLAUDE.md | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 4de79a8..b0e0f26 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,11 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Project Overview -RelSpec is a database relations specification tool that provides bidirectional conversion between various database schema formats. It reads database schemas from multiple sources (live databases, DBML, DCTX, DrawDB, etc.) and writes them to various formats (GORM, Bun, JSON, YAML, SQL, etc.). +RelSpec is a database relations specification tool that provides bidirectional conversion between various database schema formats. It reads database schemas from multiple sources and writes them to various formats. + +**Supported Readers:** Bun, DBML, DCTX, DrawDB, Drizzle, GORM, GraphQL, JSON, PostgreSQL, Prisma, SQL Directory, SQLite, TypeORM, YAML + +**Supported Writers:** Bun, DBML, DCTX, DrawDB, Drizzle, GORM, GraphQL, JSON, PostgreSQL, Prisma, SQL Exec, SQLite, Template, TypeORM, YAML ## Build Commands @@ -50,8 +54,9 @@ Database ``` **Important patterns:** -- Each format (dbml, dctx, drawdb, etc.) has its own `pkg/readers//` and `pkg/writers//` subdirectories -- Use `ReaderOptions` and `WriterOptions` structs for configuration (file paths, connection strings, metadata) +- Each format has its own `pkg/readers//` and `pkg/writers//` subdirectories +- Use `ReaderOptions` and `WriterOptions` structs for configuration (file paths, connection strings, metadata, flatten option) +- FlattenSchema option collapses multi-schema databases into a single schema for simplified output - Schema reading typically returns the first schema when reading from Database - Table reading typically returns the first table when reading from Schema @@ -65,8 +70,22 @@ Contains PostgreSQL-specific helpers: - `keywords.go`: SQL reserved keywords validation - `datatypes.go`: PostgreSQL data type mappings and conversions +### Additional Utilities + +- **pkg/diff/**: Schema difference detection and comparison +- **pkg/inspector/**: Schema inspection and analysis tools +- **pkg/merge/**: Schema merging capabilities +- **pkg/reflectutil/**: Reflection utilities for dynamic type handling +- **pkg/ui/**: Terminal UI components for interactive schema editing +- **pkg/commontypes/**: Shared type definitions + ## Development Patterns +- Each reader/writer is self-contained in its own subdirectory +- Options structs control behavior (file paths, connection strings, flatten schema, etc.) +- Live database connections supported for PostgreSQL and SQLite +- Template writer allows custom output formats + ## Testing - Test files should be in the same package as the code they test @@ -77,5 +96,6 @@ Contains PostgreSQL-specific helpers: ## Module Information - Module path: `git.warky.dev/wdevs/relspecgo` -- Go version: 1.25.5 -- Uses Cobra for CLI, Viper for configuration +- Go version: 1.24.0 +- Uses Cobra for CLI +- Key dependencies: pgx/v5 (PostgreSQL), modernc.org/sqlite (SQLite), tview (TUI), Bun ORM