Skip to content

Null* isn't compatible with std interface #754

Open
@sankalp-amigo

Description

@sankalp-amigo

Issue description

Unable to read Rows from a Table that has Null Values anywhere using the 'database/sql' interface. Even though 'sql.Nullstring' is being used. Expected to be able scan into a slice of 'sql.Nulstring' but instead get an error.

Example code

for rows.Next() {
			columns := make([]sql.NullString, len(cols))
			columnPointers := make([]interface{}, len(cols))
			for i := range columns {
				columnPointers[i] = &columns[i]
			}
			err = rows.Scan(columnPointers...)
			// Error occured while scanning a row
			if err != nil {
				fmt.Println()
				fmt.Println(err) ̑
				fmt.Println()
			}

image

Error log

sql: Scan error on column index 0, name "col1": unsupported Scan, storing driver.Value type *string into type *string

image

Configuration

OS: Ubuntu 20.04.4 LTS

Interface: database/sql

Driver version: v2.3.0

Go version: go version go1.18.2 linux/amd64

ClickHouse Server version: version 22.9.1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions