Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DevDB ¶
type DevDB struct {
// contains filtered or unexported fields
}
DevDB holds an ephemeral Postgres instance (via testcontainers) or a reference to an existing Postgres when a --dev-url is provided.
func Open ¶
Open returns a DevDB backed by an existing Postgres when devURL is non-empty, otherwise it starts an ephemeral container via Start.
func (*DevDB) Apply ¶
Apply opens a fresh connection and executes the provided SQL (which may contain multiple statements).
func (*DevDB) Close ¶
Close terminates the underlying container. It is a no-op when DevDB was created with an external --dev-url.
func (*DevDB) External ¶
External reports whether this DevDB is backed by a caller-supplied --dev-url (true) rather than an ephemeral container (false). An external database is reused across calls and therefore must be reset between independent states.
func (*DevDB) Reset ¶
Reset drops every non-system schema and recreates a clean public schema, returning the database to a near-pristine state. It is used to isolate independent introspection states that share one external --dev-url database, where (unlike the ephemeral-container path) Close is a no-op and a fresh instance is not created per call.