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

Could not convert string into time #370

Open
fairking opened this issue Apr 18, 2024 · 0 comments
Open

Could not convert string into time #370

fairking opened this issue Apr 18, 2024 · 0 comments

Comments

@fairking
Copy link

fairking commented Apr 18, 2024

In one of my query I have the following error:

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

I have reproduced the issue here: fairking/sql@94d95e4

2024/04/18 03:10:34 [duration: 0s op: adapter-query] SELECT MAX(last_visited) last_visited FROM "users" GROUP BY "users"."gender";
    \go-rel\sqlite3\query.go:155:
                Error Trace:    /go-rel/sql/specs/query.go:155
                Error:          Expected nil, but got: &fmt.wrapError{msg:"sql: Scan error on column index 0, name \"last_visited\": unsupported Scan, storing driver.Value type string into type *time.Time", err:(*errors.errorString)(0xc0003ec6c0)}
                Test:           TestAdapter_specs/FindAll#35
--- FAIL: TestAdapter_specs/FindAll#35 (0.00s)

My struct:

type ContactItem struct {
	LastVisited *time.Time `json:"lastVisited"`
}

Any idea why that happen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant