Skip to content

Struct SelectFrom should include full table name #40

@albertorestifo

Description

@albertorestifo

When making joins, it would be useful is the Struct added the table name to the fields or if it implemented a SelectFromAs method.

Right now, for example, there is no way of doing this:

var c Company
sb := companyStruct.SelectFrom("companies", &c)
sb.Join("company_balances", "company_balances.company_id = companies.company_id").
	Where(sb.E("balance_id", balanceID)).
	Limit(1)

This will fail as both the companies and company_balances table have a company_id field.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions