database

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package database scaffolds the per-service files needed to use sqlc and goose: sqlc.yaml, a starter queries.sql, an empty migrations directory and a minimal connection helper at internal/db/conn.go (kept out of db.go so sqlc's generator does not overwrite it on `task generate`).

All files are written once; on subsequent runs an existing file is left alone so developer edits survive.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scaffold

type Scaffold struct {
	// contains filtered or unexported fields
}

Scaffold writes the database scaffolding for one service.

func New

func New(servicePath string, engine projectcfg.DBEngine) *Scaffold

func (*Scaffold) Run

func (s *Scaffold) Run() error

Run writes the scaffolding files for the chosen engine. It is a no-op when no engine was selected. After writing it runs `go mod tidy` in the service directory so the freshly imported driver shows up in go.mod.

Jump to

Keyboard shortcuts

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