MCPcopy Create free account
hub / github.com/dolthub/doltgresql / GetRowResults

Function GetRowResults

testing/generation/command_docs/create_row_tests.go:116–132  ·  view source on GitHub ↗

GetRowResults runs the query against a Postgres server and returns the resulting rows.

(query string)

Source from the content-addressed store, hash-verified

114
115// GetRowResults runs the query against a Postgres server and returns the resulting rows.
116func GetRowResults(query string) ([]sql.Row, error) {
117 var err error
118 ctx := context.Background()
119 if postgresVerificationConnection == nil {
120 connectionString := fmt.Sprintf("postgres://postgres:password@127.0.0.1:%d/", 5432)
121 postgresVerificationConnection, err = pgx.Connect(ctx, connectionString)
122 if err != nil {
123 return nil, err
124 }
125 }
126 pgxRows, err := postgresVerificationConnection.Query(ctx, query)
127 if err != nil {
128 return nil, err
129 }
130 readRows, _, err := framework.ReadRows(pgxRows, true)
131 return readRows, err
132}

Callers 1

GenerateRowTestsFunction · 0.85

Calls 2

ConnectMethod · 0.80
QueryMethod · 0.45

Tested by

no test coverage detected