Skip to content

sql: Scan error on column index 1, name "timestamp": unsupported Scan, storing driver.Value type []uint8 into type *time.Time #1201

@Jille

Description

@Jille

Version

1.10.0

What happened?

sqlc assumes parseTime=true is enabled or it fails with this cryptic error message. (It's easy now that I know that setting exists though.)

I don't suppose we can do a compile check for this, so the next best thing is an at-init check? Documenting this in an easy to find place would also help.

Relevant log output

sql: Scan error on column index 1, name "timestamp": unsupported Scan, storing driver.Value type []uint8 into type *time.Time

Database schema

CREATE TABLE authors (
  id   BIGSERIAL PRIMARY KEY,
  time DATETIME NOT NULL
);
​

SQL queries

-- name: ListAuthors :many
SELECT * FROM authors;

Configuration

version: 1
packages:
  - path: "gendb"
    engine: "mysql"
    schema: "schema.sql"
    queries: "queries.sql"
    emit_prepared_queries: true

Playground URL

https://play.sqlc.dev/p/cc8dac471c61806d52951840aa88779ed61f52d5895f0b70d8be446833bf3ea7

What operating system are you using?

Linux

What database engines are you using?

MySQL

What type of code are you generating?

Go

Metadata

Metadata

Assignees

No one assigned

    Labels

    📚 mysqldocumentationImprovements or additions to documentationwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions