Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // The Directory Path of the database migrations. If this is set, // the database will be automatically migrated when generating a // new connection. MigrationsDir string }
type ConnectionInfo ¶
type ConnectionInfo struct { Host string Port string User string Password string DatabaseName string SSLMode string }
func (ConnectionInfo) ToURI ¶
func (c ConnectionInfo) ToURI() string
type EphemeralDatabase ¶
type EphemeralDatabase struct {
// contains filtered or unexported fields
}
EphemeralDatabase represents
func NewEphemeralDatabase ¶
func NewEphemeralDatabase(bootstrapConnection ConnectionInfo, config Config) (*EphemeralDatabase, error)
func NewTestEphemeralDatabase ¶
func NewTestEphemeralDatabase(config Config) (*EphemeralDatabase, error)
NewTestDatabase returns an *EphemeralDatabase spun up against our TEST_POSTGRES environment variables, which centralizes this config & simplifies our test code.
func (*EphemeralDatabase) Connection ¶
func (e *EphemeralDatabase) Connection() *sql.DB
Connection returns a reference to the connection to the ephemeral database
func (*EphemeralDatabase) Terminate ¶
func (e *EphemeralDatabase) Terminate() error
Terminate entirely deletes the ephemeral database, and also closes out the connection.
Click to show internal directories.
Click to hide internal directories.