Skip to content

Release v0.4.0

Compare
Choose a tag to compare
@KazaiMazai KazaiMazai released this 11 Aug 18:35
· 10 commits to main since this release
e9ee8f0

What's new?

One Relationship type to rule them all.

What's Changed

Full Changelog: 0.3.0...0.4.0

Breaking changes

Old relation property wrappers are not available any more. @Relationship should be used instead:

Before

//To-one optional:
@HasOne
var user: User? = nil

//To-one required:
@BelongsTo
var author: User?

//To-many:
@HasMany
var viewedBy: [User]? = nil

//Mutual relation:
@HasMany(\.chat, inverse: \.messages)
var chat: Chat?

Now

//To-one optional:
@Relationship
var user: User? = nil

//To-one required:
@Relationship(.required)
var author: User?

//To-many:
@Relationship
var viewedBy: [User]? = nil

//Mutual relation:
@Relationship(inverse: \.messages)
var chat: Chat?