Releases: liuliu/dflat
Releases · liuliu/dflat
v0.6.0
- Add XXXBuilder to help modify class-bound object (no need for struct-bound object), you can write
let xx = XXBuilder(x); xx.key = value; xx.build()
like you would in Obj-C. It is not Swifty, but useful to avoid some class of errors. - Relax condition on workspace.dictionary so as long as workspace is mutable, you can now write
workspace.dictionary["somekey"] = somevalue
, this feels more ergonomic. - Update flatbuffers dependency to latest.
- Add support to move to "ROLLBACK" again, and potentially vacuum. This helps if you want to use the result SQLite file as a single-file and move it around.
- Support observation for dictionary, so you can
workspace.dictionary.subscribe("key") { update in ... }
. There could still be some ergonomic improvements, but this helps your code to be more streamlined (i.e. having UI update all derived from observation).
v0.5.0
- Updated for Swift 5.6
- Updated to latest flatbuffers (google/flatbuffers@11a1988)
- Updated to newer apollo-ios (apollographql/apollo-ios@51c81bd)
- Updated SQLite (for non-Apple platforms) to 3.38.5
- Added light-weight in-tree documentation through Swift DocC: https://liuliu.github.io/dflat
- Added
func shutdown() async
, which effectively the same asfunc shutdown()
just doesn't blocking the thread (simply yielding to the async runtime), i.e. more async friendly. - Fixed the return
AsyncStream
fromsubscribe
method doesn't respectbufferingPolicy
passed in.
v0.4.2
- Fixed another bug in
WorkspaceDictionary
thatkeys
will show keys haven't finished deleting from underlying storage yet. removeAll
inWorkspaceDictionary
doesn't block on disk any more.- Added
AsyncSequence
support for observing individual objects orFetchedResult
. - Fixed Linux compilation issues with Swift 5.5 (
SwiftGlibc
module cannot be found).
v0.4.1
- Fixed a bug in
WorkspaceDictionary.keys
that will show deleted keys - Added
WorkspaceDictionary.removeAll()
. This should be faster than iterating through keys and remove each of them. - Added
await
interface forWorkspace.performChanges
- Support specify type when accessing
WorkspaceDictionary
, for example:dictionary["someKey", Int.self]
- Updated with benchmarks for
WorkspaceDictionary
v0.4.0
New Features
- Added
WorkspaceDictionary
which you can access fromWorkspace.dictionary
, an easy way to persist some data through key-value pairs. - Added
dflat_graphql
Bazel rule that takes GraphQL schemas and generate FlatBuffers schema that can be persisted with Dflat, this is only compatible with Apollo GraphQL's Swift code. - Added
./dflatc.py graphql
to achieve above without using Bazel rule. - Added new OrderBy primitive:
, orderBy: [someArray.firstIndex(of: Object.property)]
, this is more useful when you doxxx.in(someArray)
to enforce ordering for the returned result array. - Allow FlatBuffers schemas without
root_type
. These will generate struct conforms toFlatBuffersCodable
, which can be persisted withWorkspaceDictionary
using FlatBuffers rather than Swift Codable protocol (binary plist). - Allow using
from(data: Data) -> Self
andtoData() -> Data
to encode objects into Data objects directly. This enables not only persist data with Dflat, but passing Dflat objects over the wire. - Support explicit version string in FlatBuffers schema. This takes the form
table objectName (v: "a_version_string") {}
. This allows incompatible changes in FlatBuffers schema by having new tables with the version string encoded.
Updates
- Updated to FlatBuffers 2.0.1.
- Updated to Swift Atomics 1.0.1
- Updated to SQLite 3.36.0 (for Linux)
Bug Fixes
- Fixed a strict serializable issue because we didn't coordinate concurrent queue properly: 97392ed
- Fixed unbalanced semaphore usage when exiting (@siyuyue): a5873b3
- Fixed upsert not updating object: 033150d
- Fixed
in
query crashes with exact-1 element array: 96dc2f6
CI
- Moved to GitHub Action, with 4 variants: macos-spm, macos-bazel, ubuntu-spm, ubuntu-bazel
- Fixed a flaky test with Combine: 9f5491f
v0.3.1
v0.3.0
- Use https://github.com/apple/swift-atomics
- Support Linux
- Change
Workspace.shutdown()
to block until all writes done before return. If a completion closure provided, this will be asynchronous still.