In Development Package, API may change between versions.

import "github.com/egdaemon/eg/runtime/x/wasi/egpostgresql"

Package egpostgresql provide functionality for setting up a postgresql service within eg environments. Specifically allows for waiting for postgresql to be available, and configuring local access.

func Auto

func Auto(ctx context.Context, _ eg.Op) (err error)

configure the locally running instance of postgresql for use by local users.

func InsertSuperuser

func InsertSuperuser(name string) eg.OpFn

Create a superuser with the provided name. Should be run after Auto has initialized the default user.

func RecreateDatabase

func RecreateDatabase(name string) eg.OpFn

Forcibly creates and destroys a database. Should be run after Auto has initialized the default user.