introspect

command
v0.0.0-...-b043d65 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

This example demonstrates generating code from a live Postgres database using DSN-based introspection.

Prerequisites:

  1. A running Postgres instance
  2. Create a database and apply the schema: createdb sqlgen_example psql sqlgen_example < schema.sql
  3. Set DATABASE_URL: export DATABASE_URL="postgres://localhost:5432/sqlgen_example?sslmode=disable"

Then generate and run:

go run ../../cmd/sqlgen generate
go run .

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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