Documentation
¶
Overview ¶
Command relations shows how to declare relations (see models/models.go), load them without N+1 queries, filter by them, change them and write whole graphs.
Run it against a database that has the migrations applied:
DATABASE_URL=postgres://... go run ./examples/relations
Directories
¶
| Path | Synopsis |
|---|---|
|
Package models is the schema of the relations example: authors write documents, documents have comments and are tagged with many tags.
|
Package models is the schema of the relations example: authors write documents, documents have comments and are tagged with many tags. |
|
author
Package author holds typed column descriptors and relation descriptors for the Author model.
|
Package author holds typed column descriptors and relation descriptors for the Author model. |
|
comment
Package comment holds typed column descriptors and relation descriptors for the Comment model.
|
Package comment holds typed column descriptors and relation descriptors for the Comment model. |
|
document
Package document holds typed column descriptors and relation descriptors for the Document model.
|
Package document holds typed column descriptors and relation descriptors for the Document model. |
|
tag
Package tag holds typed column descriptors and relation descriptors for the Tag model.
|
Package tag holds typed column descriptors and relation descriptors for the Tag model. |
Click to show internal directories.
Click to hide internal directories.