ubgo is in early alpha: libraries and APIs may still change.

Skip to content
ubgo Alpha

entx

Extensions for ent such as polymorphic relations, cascade delete and per-API GraphQL schemas.

go get github.com/ubgo/entx/entpoly
Language
Go
Go version
–
Core deps
–
Latest tag
6 streams
License
Apache-2.0
Go modules
10

How it fits together

Code from the README

// One annotation on the schema
func (User) Annotations() []schema.Annotation {
    return []schema.Annotation{
        entcascade.Cascade(),
    }
}

From the entx README.

At a glance (from the README)

PackageDescription
entcascadeGenerate cascade delete functions from schema annotations
entgqlmultiGenerate per-API GraphQL schemas from a single ent schema
entpolyLaravel-style polymorphic relationships — MorphTo / MorphOne / MorphMany / MorphedByMany with compile-time + DB-level type safety + GraphQL union surface
entreadonlyMake a schema read-only at codegen — strips Create/Update/Delete builders so writes fail to compile, while edges + queries + GraphQL stay intact
entskiptableExclude externally-owned tables from ent auto-migration via a composable migration DiffHook (no DDL on tables you only read)
enttuiSchema-driven terminal UI / admin browser for ent — a k9s-style keyboard-driven data explorer generated straight from your schema