Skip to content

sqlc.embed() AS alias does not work #2655

Closed as not planned
Closed as not planned
@kevinvalk

Description

@kevinvalk

Version

1.20.0

What happened?

The alias is not used when using sqlc.embed(name) AS alias.

// add a column with a reference to an embedded table
if embed, ok := qc.embeds.Find(n); ok {
cols = append(cols, &Column{
Name: embed.Table.Name,
EmbedTable: embed.Table,
})
continue
}

I think it would make sense to keep this information available somehow as now it is impossible to name sqlc.embed when using for example joins or views.

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

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