MCPcopy Index your code
hub / github.com/coder/coder / WithDBFrom

Function WithDBFrom

coderd/database/dbtestutil/postgres.go:148–152  ·  view source on GitHub ↗

WithDBFrom sets the template database to use when creating a new database. Overrides the DB_FROM environment variable.

(dbFrom string)

Source from the content-addressed store, hash-verified

146// WithDBFrom sets the template database to use when creating a new database.
147// Overrides the DB_FROM environment variable.
148func WithDBFrom(dbFrom string) OpenOption {
149 return func(o *OpenOptions) {
150 o.DBFrom = &dbFrom
151 }
152}
153
154// WithLogDSN sets whether the DSN should be logged during testing.
155// This provides an ergonomic way to connect to test databases during debugging.

Callers 2

TestOpen_InvalidDBFromFunction · 0.92
TestOpen_ValidDBFromFunction · 0.92

Calls

no outgoing calls

Tested by 2

TestOpen_InvalidDBFromFunction · 0.74
TestOpen_ValidDBFromFunction · 0.74