Skip to content

Namespace all of a table’s columns using * #249

Closed
@S4TNEW

Description

@S4TNEW

Hello,

after changing to the swift2 branch it is not possible to select all table columns from a join query using [*]:

let db = FLFDBManager.sharedInstance.database()!
var tyres = Table(FLFDatabaseTables.MountedTyre)
let articles = Table(FLFDatabaseTables.Article)
let brands = Table(FLFDatabaseTables.Brand)
let vehicles = Table(FLFDatabaseTables.Vehicle)
let warehouses = Table(FLFDatabaseTables.Warehouse)

tyres = tyres.join(JoinType.LeftOuter,
            articles, on:
                tyres[FLFMountedTyre.kItemNumber] == articles[FLFArticle.kItemNumber] &&
                tyres[FLFMountedTyre.kCompanyId] == articles[FLFArticle.kCompanyId])
tyres = tyres.join(JoinType.Inner,
            brands, on:
                articles[FLFArticle.kBrand] == brands[FLFBrand.kBrandcode])
tyres = tyres.join(JoinType.Inner,
            vehicles, on:
                tyres[FLFMountedTyre.kVehicleNo] == vehicles[FLFVehicle.kVehicleNo] &&
                tyres[FLFMountedTyre.kCompanyId] == vehicles[FLFVehicle.kCompanyId])
tyres = tyres.join(JoinType.Inner,
            warehouses, on:
                tyres[FLFMountedTyre.kWarehouseNo] == warehouses[FLFWarehouse.kWarehouseNo])

tyres = tyres.filter(tyres[FLFMountedTyre.kCompanyId] == companyId && vehicles[FLFVehicle.kCustomerNo] == customerNo)
let x = tyres.select(tyres[*]) // Error: Cannot invoke 'select' with an argument list of tyre '(Expression<Void>)'

Are we doing something wrong? According to the documentation this should work as it has been in the trunk version. If we change the [*] to any column name the compile succeeds but we don't want to add every column manually in the code.

Thank you in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions