Documentation
¶
Overview ¶
Example: internals
Shows what drel's codegen produces under the hood. Everything here — ModelMeta, Scan, Snapshot, Diff, column references — is normally generated into <model>_drel.go files. This example hand-crafts them so you can see the machinery without running the code generator.
Covers: queries (Find, Where, OrderBy, Limit, OR, Count, Exists, string Contains) AND transactions (insert, update with change tracking, delete, rollback, mid-tx SaveChanges).
Usage:
export DATABASE_URL="postgres://localhost:5432/drelexample?sslmode=disable" go run ./examples/internals/
Click to show internal directories.
Click to hide internal directories.