What problem does it solve?
Working with Ent ORM in a large Go codebase involves subtle pitfalls: Postgres array columns silently mapping to jsonb, truncated identifier names colliding, upserts that fail to clear nullable fields, and generated code that must never be hand-edited. This Skill encodes those hard-won conventions so schema changes and query work are done correctly the first time.
Core Features & Use Cases
- Schema authoring guidance: Correct patterns for Postgres
text[] columns via field.Other with pq.StringArray, char(26) ULID foreign keys, soft-delete unique indexes, and JSONB value scanners.
- Custom selects and joins: Use generated
entselectedparse helpers like db.Parse<Entity>FromSelectedValues instead of hand-written row scanners.
- Update and upsert correctness: Rules for
UpdateNewValues(), SetOrClear<Field> helpers, and pointer GoTypes that lack SetNillable<Field> variants.
- Use Case: You add a new nullable column to an Ent schema, regenerate with
make generate, and need the upsert path to properly clear the column when the value is absent.
Quick Start
Ask the assistant to modify an Ent schema under openmeter/ent/schema and regenerate the code following the ent skill conventions.