Skip to content

Commit ff86f30

Browse files
Handle nullable columns for databases using pointers
Some databases (e.g. clickhouse) is using pointer values to represent nullable values when querying from the database. The current logic to transform values to strings when querying data, does not handle this correctly. It will simply transform the pointer to a string, which results in the pointer address being printed. To handle this, the value reported from the sql driver will now tried to be extracted, if it is a pointer. This means the value of the pointer will then be transformed to a string, instead of the pointer directly. Additionally, some cases where this was causing issues in the clickhouse implementation have been fixed. Fixes sqls-server#151
1 parent eb695ac commit ff86f30

File tree

4 files changed

+97
-67
lines changed

4 files changed

+97
-67
lines changed

go.mod

+14-14
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/denisenkom/go-mssqldb v0.12.3
88
github.com/go-sql-driver/mysql v1.7.1
99
github.com/godror/godror v0.41.0
10-
github.com/google/go-cmp v0.5.9
10+
github.com/google/go-cmp v0.6.0
1111
github.com/jackc/pgx/v4 v4.18.1
1212
github.com/jfcote87/sshdb v0.5.3
1313
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
@@ -18,26 +18,26 @@ require (
1818
)
1919

2020
require (
21+
github.com/ClickHouse/clickhouse-go/v2 v2.23.2
2122
github.com/k0kubun/pp v3.0.1+incompatible
2223
github.com/mattn/go-sqlite3 v1.14.19
2324
github.com/olekukonko/tablewriter v0.0.5
2425
github.com/vertica/vertica-sql-go v1.3.3
2526
)
2627

2728
require (
28-
github.com/ClickHouse/ch-go v0.58.2 // indirect
29-
github.com/ClickHouse/clickhouse-go/v2 v2.17.1 // indirect
30-
github.com/andybalholm/brotli v1.0.6 // indirect
29+
github.com/ClickHouse/ch-go v0.61.5 // indirect
30+
github.com/andybalholm/brotli v1.1.0 // indirect
3131
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
3232
github.com/elastic/go-sysinfo v1.11.2 // indirect
3333
github.com/elastic/go-windows v1.0.1 // indirect
3434
github.com/go-faster/city v1.0.1 // indirect
35-
github.com/go-faster/errors v0.6.1 // indirect
35+
github.com/go-faster/errors v0.7.1 // indirect
3636
github.com/go-logfmt/logfmt v0.6.0 // indirect
3737
github.com/godror/knownpb v0.1.1 // indirect
3838
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
3939
github.com/golang-sql/sqlexp v0.1.0 // indirect
40-
github.com/google/uuid v1.5.0 // indirect
40+
github.com/google/uuid v1.6.0 // indirect
4141
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
4242
github.com/jackc/pgconn v1.14.1 // indirect
4343
github.com/jackc/pgio v1.0.0 // indirect
@@ -46,26 +46,26 @@ require (
4646
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect
4747
github.com/jackc/pgtype v1.14.0 // indirect
4848
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect
49-
github.com/klauspost/compress v1.16.7 // indirect
49+
github.com/klauspost/compress v1.17.8 // indirect
5050
github.com/mattn/go-colorable v0.1.6 // indirect
5151
github.com/mattn/go-isatty v0.0.12 // indirect
5252
github.com/mattn/go-runewidth v0.0.15 // indirect
53-
github.com/paulmach/orb v0.10.0 // indirect
54-
github.com/pierrec/lz4/v4 v4.1.18 // indirect
53+
github.com/paulmach/orb v0.11.1 // indirect
54+
github.com/pierrec/lz4/v4 v4.1.21 // indirect
5555
github.com/pkg/errors v0.9.1 // indirect
5656
github.com/prometheus/procfs v0.12.0 // indirect
5757
github.com/rivo/uniseg v0.4.4 // indirect
5858
github.com/russross/blackfriday/v2 v2.1.0 // indirect
5959
github.com/segmentio/asm v1.2.0 // indirect
60-
github.com/shopspring/decimal v1.3.1 // indirect
60+
github.com/shopspring/decimal v1.4.0 // indirect
6161
github.com/sirupsen/logrus v1.9.3 // indirect
6262
github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e // indirect
63-
go.opentelemetry.io/otel v1.19.0 // indirect
64-
go.opentelemetry.io/otel/trace v1.19.0 // indirect
63+
go.opentelemetry.io/otel v1.26.0 // indirect
64+
go.opentelemetry.io/otel/trace v1.26.0 // indirect
6565
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect
66-
golang.org/x/sys v0.15.0 // indirect
66+
golang.org/x/sys v0.19.0 // indirect
6767
golang.org/x/text v0.14.0 // indirect
68-
google.golang.org/protobuf v1.32.0 // indirect
68+
google.golang.org/protobuf v1.33.0 // indirect
6969
gopkg.in/yaml.v3 v3.0.1 // indirect
7070
howett.net/plist v1.0.1 // indirect
7171
)

0 commit comments

Comments
 (0)