Repository navigation
New Features
Derivable ULIDs
You can now derive a new ULID from an existing ULID using ulid.deriveNew().
On the same ULID deriveNew() will always return the same ULID. The new ULID’s timestamp is almost the same as the parent ULID’s, so the new one will sort near the parent. The purpose of this is being able to predictably migrate to a new schema version where re-using the old ulids isn’t enough.
For example if you want to split up a model User so ContactInformation is a relationship instead of being part of User, you can use this to derive a ULID for the ContactInformation instance from the User’s ULID.
This will especially become important when syncing in the future.
Stale Reference Cleanup
ManagedObjectContext/checkRelationshipIntegrity(_:) recieved a new parameter to opt in to cleaning up stale relationship references while checking the integrity. Stale references can be created by having a relationship without inverse (Vein’s relationships are designed to be bidirectional) and deleting the child without removing it from the parent for example (or bugs from the past).
SwiftDataCompat trait
The new SwiftDataCompat trait changes the environment paths used by VeinSwiftUI so they don’t collide with SwiftData.
Added some more typed SQLite errors
Some potentially common errors like SQLITE_BUSY were added to ManagedObjectContextError
Bugfixes
Changes to a child model didn’t trigger the change notification on the parent for VeinSCUI. This has been fixed. The issue likely was that the default implementation didn’t provide a stable Publisher instance. @Model now generates it as part of the expansion.
Breaking changes
Reinsertion of a deleted model now throws an error. Once a model has been removed it’s impossible to guarantee integrity. It shouldn’t have been possible to re insert them in the first place. I apologize for the inconvenience.
Other Code changes
ManagedObjectContext/batchDelete(_:) is now deprecated and will be removed in 2.0. I recommend switching to a loop with ManagedObjectContext/delete(_:).
Other Changes
The concurrency description and recommendations were updated. Please make sure to read the new section. Most important change: Vein models are thread-safe for reads and value field writes. Concurrent writes to relationships are not yet recommended.
Of course new tests covering the new features as well as expanding the coverage of existing code were added. There were no new discoveries of bugs.
Security
There are no security related changes and no known vulnerabilities.
New backup admin
To ensure there is someone with the necessary permissions to maintain this repository, or name a new maintainer, in case the current maintainer is unavailable, @stackotter from the @moreSwift org (making SwiftCrossUI and Swift Bundler) was added as a backup admin. He is not involved in day-to-day maintenance of this package, please don’t contact him with Vein related issues.
What's Changed
- Update doc generation script by @MiaKoring in #170
- More tests by @MiaKoring in #172
- Disallow reinsertion of deleted models by @MiaKoring in #173
- There are never enough tests lol by @MiaKoring in #176
- Make capture in observer weak and remove observers on delete by @MiaKoring in #177
- fix observability of child changes in SCUI (#178) by @MiaKoring in #179
- made ULIDs derivable by @MiaKoring in #180
- Adds stale reference cleanup option to relationship integrity check by @MiaKoring in #182
- Swiftdata compat trait by @MiaKoring in #183
- added some more sqlite errors that seemed commonly possible by @MiaKoring in #185
- Update readme by @MiaKoring in #187
- Added more specific doc comments regarding thread safety by @MiaKoring in #189
- Modify CodeQL workflow for Swift build settings by @MiaKoring in #190
- Update SwiftFormat lint workflow for Ubuntu by @MiaKoring in #192
- Only install gtk for codeql when needed and before setup by @MiaKoring in #193
Full Changelog: 1.2.0...1.3.0