Skip to content

SQLite: column alias not recognized without AS #2559

Closed
@orisano

Description

@orisano

Version

1.20.0

What happened?

Column alias is not recognized in SQLite if AS is not specified.

-- name: Value :one
SELECT 1 x, 2 y;

expected:

type ValueRow struct {
	X int64
	Y int64
}

actual:

type ValueRow struct {
	Column1 int64
	Column2 int64
}

It works well with the following.

-- name: Value :one
SELECT 1 AS x, 2 AS y;

Relevant log output

No response

Database schema

No response

SQL queries

SELECT 1 x, 2 y;

Configuration

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

Playground URL

https://play.sqlc.dev/p/7230cad224088b2a31b97ef4e18fb5dfd470a234376892879d46b5d19fd4d098

What operating system are you using?

No response

What database engines are you using?

SQLite

What type of code are you generating?

Go

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageNew issues that hasn't been reviewed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions