pgx/pgtype
Cemre Mengu 2a653b4a8d fix: handle null interface for json
When using `scany` I encountered the following case. This seems to fix it.

Looks like null `jsonb` columns cause the problem. If you create a table like below you can see that the following code fails. Is this expected?

```sql
CREATE TABLE test (
	a int4 NULL,
	b int4 NULL,
	c jsonb NULL
);

INSERT INTO test (a, b, c) VALUES (1, null, null);
```

```go
package main

import (
	"context"
	"log"

	"github.com/georgysavva/scany/v2/pgxscan"
	"github.com/jackc/pgx/v5"
)

func main() {
	var rows []map[string]interface{}
	conn, _ := pgx.Connect(context.Background(), , ts.PGURL().String())
	
	// this will fail with can't scan into dest[0]: cannot scan NULL into *interface {}
	err := pgxscan.Select(context.Background(), conn, &rows, `SELECT c from test`) 
	
	// this works
	// err = pgxscan.Select(context.Background(), conn, &rows, `SELECT a,b from test`)
	
	if err != nil {
		panic(err)
	}

	log.Printf("%+v", rows)
}
```
2023-03-25 10:22:11 -05:00
..
2022-04-09 09:12:55 -05:00
2023-02-10 20:21:25 -06:00
2022-04-16 14:21:40 -05:00
2022-04-09 09:12:55 -05:00
2022-04-09 09:12:55 -05:00
2022-04-02 14:34:19 -05:00
2022-04-02 14:34:19 -05:00
2022-04-09 09:12:55 -05:00
2022-04-02 14:34:19 -05:00
2022-04-09 09:12:55 -05:00
2022-04-09 09:12:55 -05:00
2022-04-09 09:12:55 -05:00
2022-11-12 07:06:54 -06:00
2022-04-09 09:12:55 -05:00
2022-04-09 09:12:55 -05:00
2022-07-11 08:07:23 -05:00
2022-04-09 09:09:46 -05:00
2022-12-17 09:10:02 -06:00
2022-04-02 14:34:19 -05:00
2022-04-09 09:12:55 -05:00
2023-03-25 10:22:11 -05:00
2022-04-09 09:12:55 -05:00
2022-04-09 09:12:55 -05:00
2022-04-02 14:34:19 -05:00
2022-04-09 09:12:55 -05:00
2022-04-02 14:34:19 -05:00
2022-09-24 10:30:12 -05:00
2022-04-09 09:12:55 -05:00
2022-04-09 09:12:55 -05:00
2022-04-09 09:12:55 -05:00
2022-04-09 09:12:55 -05:00
2023-02-21 21:04:30 -06:00
2022-04-02 14:34:19 -05:00
2022-04-09 09:12:55 -05:00
2022-04-09 09:12:55 -05:00
2022-04-09 09:12:55 -05:00
2022-04-02 14:34:19 -05:00
2022-04-23 11:10:04 -05:00
2022-04-23 11:10:04 -05:00
2022-04-09 09:12:55 -05:00
2022-05-12 17:13:49 -05:00
2022-04-02 14:34:19 -05:00
2023-01-24 07:55:00 -06:00
2022-04-02 14:34:19 -05:00
2022-04-09 09:12:55 -05:00
2022-04-02 14:34:19 -05:00
2022-04-09 09:12:55 -05:00
2022-04-02 14:34:19 -05:00
2022-04-09 09:12:55 -05:00
2022-04-02 14:34:19 -05:00
2022-04-26 08:37:10 -05:00
2022-04-26 08:37:10 -05:00