Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
DSN string `env:"POSTGRESQL_DSN,required"`
}
Config includes configuration to initialize a gorm.DB to a PostgreSQL server.
type Plugin ¶
Plugin is a plugin that provides an instance of gorm.DB. Check gorm.io to see how to use gorm to work with databases. The plugin requires Config is registered in advance.
Usage ¶
app.With(&postgresgorm.Plugin{})
func (*Plugin) Initialize ¶
Initialize creates a new instance of *gorm.DB with the given configuration. And then registers it into the application as `gorm`.
Click to show internal directories.
Click to hide internal directories.