Skip to content

馃獨 Column, Alias, Table, and builders

Pre-release
Pre-release

Choose a tag to compare

@MihaelIsaev MihaelIsaev released this 22 Apr 23:31
· 177 commits to master since this release
fea1745

Breaking changes

SwifQLAlias renamed to TableAlias

Now we're able to build table models

final class User: Table {
    @Column("id")
    var id: UUID

    @Column("email")
    var email: String
}

and access table columns through keyPath like this \User.$id and \User.$email

New @Alias property wrapper

struct Result: Aliasable {
    @Alias("anything") var emailAddress: String
}
let query = SwifQL.select(\User.$email => \Result.$emailAddress).from(User.table)
// SELECT "User"."email" as "anything" FROM "User"