Directories
¶
| Path | Synopsis |
|---|---|
|
Command adopt-existing-schema reads a database that began as plain SQL (legacy.sql) and was then adopted with `momo migrate baseline`.
|
Command adopt-existing-schema reads a database that began as plain SQL (legacy.sql) and was then adopted with `momo migrate baseline`. |
|
models
Package models describes a schema that already exists in a database.
|
Package models describes a schema that already exists in a database. |
|
models/order
Package order holds typed column descriptors and relation descriptors for the Order model.
|
Package order holds typed column descriptors and relation descriptors for the Order model. |
|
models/user
Package user holds typed column descriptors and relation descriptors for the User model.
|
Package user holds typed column descriptors and relation descriptors for the User model. |
|
Command crud-zero-null shows insert, select, update and delete, and above all how Momo tells a zero value from NULL from "leave it alone".
|
Command crud-zero-null shows insert, select, update and delete, and above all how Momo tells a zero value from NULL from "leave it alone". |
|
models
Package models is the schema of the crud-zero-null example: one table of tasks that shows how a write tells zero from NULL from "not mentioned".
|
Package models is the schema of the crud-zero-null example: one table of tasks that shows how a write tells zero from NULL from "not mentioned". |
|
models/task
Package task holds typed column descriptors and relation descriptors for the Task model.
|
Package task holds typed column descriptors and relation descriptors for the Task model. |
|
Command custom-sql-migration looks accounts up by email, ignoring case, on a database whose migrations (generated and hand-written) are applied.
|
Command custom-sql-migration looks accounts up by email, ignoring case, on a database whose migrations (generated and hand-written) are applied. |
|
models
Package models is the schema of the custom-sql-migration example.
|
Package models is the schema of the custom-sql-migration example. |
|
models/account
Package account holds typed column descriptors and relation descriptors for the Account model.
|
Package account holds typed column descriptors and relation descriptors for the Account model. |
|
internal
|
|
|
exampletest
Package exampletest is the harness every examples/<name> test uses.
|
Package exampletest is the harness every examples/<name> test uses. |
|
Command projection-pagination shows how to read only the columns a screen needs, page through a large table with a keyset cursor, and count.
|
Command projection-pagination shows how to read only the columns a screen needs, page through a large table with a keyset cursor, and count. |
|
models
Package models is the schema of the projection-pagination example: a table of articles, plus two small result types that read only some of its columns.
|
Package models is the schema of the projection-pagination example: a table of articles, plus two small result types that read only some of its columns. |
|
models/article
Package article holds typed column descriptors and relation descriptors for the Article model.
|
Package article holds typed column descriptors and relation descriptors for the Article model. |
|
Command quickstart is the compiled source of the snippets in the root README.
|
Command quickstart is the compiled source of the snippets in the root README. |
|
models
Package models is the schema of the quickstart: authors and their posts, each post carrying an embedding for similarity search.
|
Package models is the schema of the quickstart: authors and their posts, each post carrying an embedding for similarity search. |
|
models/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. |
|
models/post
Package post holds typed column descriptors and relation descriptors for the Post model.
|
Package post holds typed column descriptors and relation descriptors for the Post model. |
|
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.
|
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. |
|
models
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. |
|
models/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. |
|
models/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. |
|
models/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. |
|
models/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. |
|
Command testing shows how to test application code against a real PostgreSQL database with momotest: a database or a transaction per test, the project's embedded migrations applied, seeded fixtures, and tests that run in parallel.
|
Command testing shows how to test application code against a real PostgreSQL database with momotest: a database or a transaction per test, the project's embedded migrations applied, seeded fixtures, and tests that run in parallel. |
|
models
Package models is the schema of the testing example: bank accounts whose balance the database refuses to take below zero.
|
Package models is the schema of the testing example: bank accounts whose balance the database refuses to take below zero. |
|
models/account
Package account holds typed column descriptors and relation descriptors for the Account model.
|
Package account holds typed column descriptors and relation descriptors for the Account model. |
|
Command transactions shows how to group writes so they all happen or none do: db.Tx, rollback on error, savepoints for a step that may fail, read-only and isolation options, and a retry loop for serialization failures.
|
Command transactions shows how to group writes so they all happen or none do: db.Tx, rollback on error, savepoints for a step that may fail, read-only and isolation options, and a retry loop for serialization failures. |
|
models
Package models is the schema of the transactions example: bank accounts whose balance the database refuses to take below zero.
|
Package models is the schema of the transactions example: bank accounts whose balance the database refuses to take below zero. |
|
models/account
Package account holds typed column descriptors and relation descriptors for the Account model.
|
Package account holds typed column descriptors and relation descriptors for the Account model. |
|
Command upgrade-database reads the customers of a database that was upgraded from schema v1 to the latest version with `momo migrate apply`.
|
Command upgrade-database reads the customers of a database that was upgraded from schema v1 to the latest version with `momo migrate apply`. |
|
models
Package models is the schema of the upgrade-database example, at its latest version.
|
Package models is the schema of the upgrade-database example, at its latest version. |
|
models/customer
Package customer holds typed column descriptors and relation descriptors for the Customer model.
|
Package customer holds typed column descriptors and relation descriptors for the Customer model. |
|
Command vector-search shows nearest-neighbour search with pgvector: the column and HNSW index (see models/models.go and the migration), a query ordered by a distance, filters, a limit, and per-search settings.
|
Command vector-search shows nearest-neighbour search with pgvector: the column and HNSW index (see models/models.go and the migration), a query ordered by a distance, filters, a limit, and per-search settings. |
|
models
Package models is the schema of the vector-search example: items with an embedding, indexed for nearest-neighbour search.
|
Package models is the schema of the vector-search example: items with an embedding, indexed for nearest-neighbour search. |
|
models/item
Package item holds typed column descriptors and relation descriptors for the Item model.
|
Package item holds typed column descriptors and relation descriptors for the Item model. |
Click to show internal directories.
Click to hide internal directories.