Help us shape the future of Go! Take the 2026 Go Developer Survey

go-wormhole

module
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2026 License: MIT

README

go-wormhole

An Entity Framework-inspired ORM / Data Mapper for Go, built on top of go-foundation.

Type-safe queries · Zero code generation · Dual SQL/NoSQL backends · Code-First Migrations

dsl.Register(User{})

ctx := wh.New(provider.Default())
var u User
ctx.Set(&u).Find(42)
u.Age = 35
ctx.Save()  // → UPDATE "users" SET "age" = ? WHERE "id" = ?

Features

  • Pointer-tracking DSL — compile-time type-safe queries, no code generation
  • Change Tracker — Unit of Work with partial UPDATE (only changed columns)
  • SQL + NoSQL — pluggable providers for PostgreSQL, SQLite, MySQL, MongoDB, Slipstream (Bitcask), MemDoc (in-memory)
  • Cross-Engine Sync — migrate data between different engines (e.g. MSSQL to Postgres) with identity/sequence handling
  • Engine-Specific Naming — automatic mapping between conventions (PascalCase for MSSQL, snake_case for others)
  • Code-First Migrations — EF Core-style differ, runner, CLI, scaffold, multi-dialect DDL
  • Resilience — retry with backoff, circuit breaker, aggregated MultiError
  • Lifecycle Hooks — BeforeSave(), AfterInsert() auto-discovered via reflection
  • DI-ready — first-class go-foundation/pkg/di integration

Documentation

Chapter Topic
01 — Getting Started Install, define entities, first query in 3 steps
02 — Pointer-Tracking DSL How it works, all operators, type safety
03 — Change Tracker Unit of Work, snapshots, partial updates, hooks
04 — Code-First Migrations Differ, runner, CLI, scaffold, dialects
05 — Providers SQL provider, Slipstream, multi-backend setup
06 — Resilience Retry, circuit breaker, MultiError
07 — Architecture Internals, data flows, design decisions
08 — Relationships 1:1, 1:N, N:M declarations, eager loading with Include

License

MIT

Directories

Path Synopsis
cmd
wormhole command
pkg
dsl
sql

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL