MCPcopy Index your code
hub / github.com/bytebase/bytebase / getPgContainer

Function getPgContainer

backend/tests/testcontainer.go:19–30  ·  view source on GitHub ↗

getPgContainer creates a PostgreSQL container for testing

(ctx context.Context)

Source from the content-addressed store, hash-verified

17
18// getPgContainer creates a PostgreSQL container for testing
19func getPgContainer(ctx context.Context) (*Container, error) {
20 tc, err := testcontainer.GetPgContainer(ctx)
21 if err != nil {
22 return nil, err
23 }
24 return &Container{
25 Container: tc,
26 host: tc.GetHost(),
27 port: tc.GetPort(),
28 db: tc.GetDB(),
29 }, nil
30}
31
32// getMySQLContainer creates a MySQL container for testing
33func getMySQLContainer(ctx context.Context) (*Container, error) {

Calls 4

GetPgContainerFunction · 0.92
GetDBMethod · 0.65
GetHostMethod · 0.45
GetPortMethod · 0.45