Skip to content

MySQL: integer types for int8 and int16 are missing and use int32 #1856

Open
@Funzinator

Description

@Funzinator

Version

1.15.0

What happened?

For MySQL, the usage of SMALLINT and TINYINT (except TINYINT(1)) result in int32 while int16 and int8 respectively would be the correct choice.
The PostgreSQL implementation does map correctly.

Relevant log output

No response

Database schema

CREATE TABLE authors (
  id   INT UNSIGNED PRIMARY KEY,
  id_author SMALLINT NOT NULL,
  id_name BIGINT NOT NULL
);

SQL queries

No response

Configuration

{
  "version": "1",
  "packages": [
    {
      "path": "db",
      "engine": "mysql",
      "schema": "query.sql",
      "queries": "query.sql"
    }
  ]
}

Playground URL

https://play.sqlc.dev/p/62380b5c7ae894a511e870a044c334871d577b9fec10a9f11fdd4c114e7ba3b1

What operating system are you using?

macOS

What database engines are you using?

MySQL

What type of code are you generating?

Go

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions