Documentation ¶
Index ¶
- func DB() error
- func DBWithName(name string) error
- func DumpSchema() error
- func Generate() error
- func Migrate() error
- func MustGetConnString() string
- func Postgres(name string) error
- func Rollback(to int) error
- func SqlcCommand() func(args ...string) error
- func SqlcConfig() error
- func TernCommand() func(args ...string) error
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
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 MustGetConnString ¶ added in v0.6.1
func MustGetConnString() string
func SqlcCommand ¶ added in v0.2.0
SqlcCommand returns a command function that runs sqlc in docker with the current working directory mounted.
func TernCommand ¶ added in v0.2.0
SqlcCommand returns a command function that runs tern in docker with host networking and the current working directory mounted.
Types ¶
This section is empty.