sql

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DB

func DB() error

DB calls DBWithName using the current directory name as the database name.

func DBWithName added in v0.3.2

func DBWithName(name string) error

DBWithName creates a database and login role with the same name and the password 'pass'.

func DumpSchema

func DumpSchema() error

DumpSchema writes the current database schema to "./postgres/schema.sql".

func Generate added in v0.2.0

func Generate() error

Generate uses sqlc to compile the SQL queries in postgres/queries.sql to Go, adding he default sqlc.yaml file if necessary.

func Migrate

func Migrate() error

Migrate the database to the latest version using the migrations in "./schema".

func Postgres

func Postgres(name string) error

Postgres creates a local Postgres instance using docker.

func Rollback

func Rollback(to int) error

Rollback to the specific schema version.

func SqlcCommand added in v0.2.0

func SqlcCommand() func(args ...string) error

SqlcCommand returns a command function that runs sqlc in docker with the current working directory mounted.

func SqlcConfig added in v0.2.0

func SqlcConfig() error

SqlcConfig adds the default sqlc config.

func TernCommand added in v0.2.0

func TernCommand() func(args ...string) error

SqlcCommand returns a command function that runs tern in docker with host networking and the current working directory mounted.

Types

This section is empty.

Jump to

Keyboard shortcuts

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