quickstart

command
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

README

quickstart

What this shows

The compiled source of the snippets in the root README: models, code generation, insert, select, update, delete, relations, a vector similarity query and a transaction. readme_test.go fails when a README snippet drifts from this code.

Run

cd examples/quickstart
export DATABASE_URL=postgres://user:pass@localhost:5432/scratch
go run .

This example has no migrations: the root README walks through creating them with momo migrate diff. See examples/README.md for the examples that run end to end in CI.

Documentation

Overview

Command quickstart is the compiled source of the snippets in the root README. TestReadmeSnippetsAreCompiled keeps the two in step, so edit the code here and the README together.

Run it against a database that has the migrations applied:

DATABASE_URL=postgres://... go run ./examples/quickstart

Directories

Path Synopsis
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.
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.
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL