(t *testing.T)
| 94 | } |
| 95 | |
| 96 | func TestBindingWithTextArray(t *testing.T) { |
| 97 | ctx, connection, controller := CreateServer(t, "postgres") |
| 98 | defer func() { |
| 99 | connection.Close(ctx) |
| 100 | controller.Stop() |
| 101 | require.NoError(t, controller.WaitForStop()) |
| 102 | }() |
| 103 | conn := connection.Default |
| 104 | |
| 105 | m := pgtype.NewMap() |
| 106 | textArray := []string{"foo", "bar"} |
| 107 | |
| 108 | plan := m.PlanEncode(pgtype.TextArrayOID, pgtype.BinaryFormatCode, textArray) |
| 109 | encodedArr, err := plan.Encode(textArray, nil) |
| 110 | require.NoError(t, err) |
| 111 | |
| 112 | args := [][]byte{encodedArr} |
| 113 | paramOIDs := []uint32{1009} |
| 114 | paramFormats := []int16{1} |
| 115 | sql := "SELECT $1::text[]" |
| 116 | |
| 117 | resultReader := conn.PgConn().ExecParams(ctx, sql, args, paramOIDs, paramFormats, nil) |
| 118 | result := resultReader.Read() |
| 119 | require.NoError(t, result.Err) |
| 120 | } |
nothing calls this directly
no test coverage detected