Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nullable vectors map to pgvector.Vector #3549

Open
newhook opened this issue Aug 15, 2024 · 0 comments
Open

nullable vectors map to pgvector.Vector #3549

newhook opened this issue Aug 15, 2024 · 0 comments
Labels
📚 postgresql bug Something isn't working

Comments

@newhook
Copy link

newhook commented Aug 15, 2024

Version

1.27.0

What happened?

I think nullable vectors should map to a *pgvector.Vector? The current code doesn't work for nil vectors:

Error=can't scan into dest[7]: unsupported data type: <nil>

Which seems to map the scan code for pgvector:

func (v *Vector) Scan(src interface{}) (err error) {
	switch src := src.(type) {
	case []byte:
		return v.Parse(string(src))
	case string:
		return v.Parse(src)
	default:
		return fmt.Errorf("unsupported data type: %T", src)
	}
}

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

No response

Playground URL

No response

What operating system are you using?

No response

What database engines are you using?

No response

What type of code are you generating?

No response

@newhook newhook added the bug Something isn't working label Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 postgresql bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant