Hein db6cd21511
Some checks are pending
CI / Build (push) Waiting to run
CI / Test (1.23) (push) Waiting to run
CI / Test (1.24) (push) Waiting to run
CI / Test (1.25) (push) Waiting to run
CI / Lint (push) Waiting to run
Added more examples and pgsql reader
2025-12-17 10:08:50 +02:00
2025-12-16 13:12:43 +02:00
2025-12-16 13:12:43 +02:00
2025-12-16 18:10:40 +02:00
2025-12-17 10:08:50 +02:00
2025-12-16 13:12:43 +02:00
2025-12-16 13:12:43 +02:00
2025-12-16 13:12:43 +02:00
2025-12-16 18:10:40 +02:00
2025-12-16 13:12:43 +02:00
2025-12-17 10:08:50 +02:00
2025-12-17 10:08:50 +02:00
2025-12-16 08:38:49 +00:00
2025-12-16 13:12:43 +02:00
2025-12-17 10:08:50 +02:00
2025-12-16 18:10:40 +02:00
2025-12-16 18:10:40 +02:00

RelSpec

Database Relations Specification Tool for Go

RelSpec is a comprehensive database relations management tool that reads, transforms, and writes database table specifications across multiple formats and ORMs.

Overview

RelSpec provides bidirectional conversion between various database specification formats, allowing you to:

  • Inspect live databases and extract their structure
  • Convert between different ORM models (GORM, Bun)
  • Transform legacy schema definitions (Clarion DCTX, XML, JSON)
  • Generate standardized specification files (JSON, YAML)

1.00

Features

Input Formats

  • XML - Generic XML schema definitions
  • JSON - JSON-based schema specifications
  • Clarion DCTX - Clarion database dictionary format
  • Database Inspection - Direct database introspection
  • GORM Models - Read existing GORM Go structs
  • Bun Models - Read existing Bun Go structs

Output Formats

  • GORM Models - Generate GORM-compatible Go structs
  • Bun Models - Generate Bun-compatible Go structs
  • JSON - Standard JSON schema output
  • YAML - Human-readable YAML format

Installation

go get github.com/wdevs/relspecgo

Usage

# Inspect database and generate GORM models
relspec --input db --conn "postgres://..." --output gorm --out-file models.go

# Convert GORM models to Bun
relspec --input gorm --in-file existing.go --output bun --out-file bun_models.go

# Export database schema to JSON
relspec --input db --conn "mysql://..." --output json --out-file schema.json

# Convert Clarion DCTX to YAML
relspec --input dctx --in-file legacy.dctx --output yaml --out-file schema.yaml

Project Structure

relspecgo/
├── cmd/              # CLI application
├── pkg/
│   ├── readers/      # Input format readers
│   ├── writers/      # Output format writers
│   ├── models/       # Internal data models
│   └── transform/    # Transformation logic
├── examples/         # Usage examples
└── tests/            # Test files

Development

Prerequisites

  • Go 1.21 or higher
  • Access to test databases (optional)

Building

go build -o relspec ./cmd/relspec

Testing

go test ./...

License

Apache License 2.0 - See LICENSE for details.

Copyright 2025 wdevs

Contributing

Contributions welcome. Please open an issue or submit a pull request.

Description
Resolve Spec Go
Readme Apache-2.0 7.4 MiB
v1.0.12 Latest
2026-01-10 16:28:51 +00:00
Languages
Go 96.5%
TypeScript 2.1%
Shell 0.8%
Makefile 0.6%