Releases: Miha-x64/Lychee
0.0.17
Persistence
- added FieldSet.contains(FieldSet)
- fixed Schema.fieldByName for nonexistent names
Properties
- casValue now does equality check, not identity check (useful for boxed primitives and looks more user-friendly)
- strictly required syncIf overloads to be called with named arguments
- added
just(T)
function factory which returns() -> T
Android bindings
- RemoteViews.bind()
- more flexible setWhen(Long)Clicked
HTTP
- using Call.Factory interface instead of OkHttpClient class
SQL
- nativeType() lambdas receive Connection
- added Transaction.update(Table, ID, PartialStruct)
- deprecated Transaction.truncate
- [Eagerly|Lazily].[cell|struct] versions for returning null instead of throwing an exception
0.0.16
Properties
- fixed re-subscription during notification
- fixed removing queued listeners from single-thread properties
- added meaningful
Property.toString()
SQL
- Templates:
session.query()
->Query()
- Templates: added
executeForRowCount()
andexecuteForInsertedKey()
Transaction.insert(Struct)
now acceptsPartialStruct
s- Triggers: destructuring for
ListChanges
(val (ins, upd, del) = report.of(…)
) - removed ActiveRecord API stubs
Exteneded Persistence
SCH.buildPartial {}
->SCH.Partial {}
Android
- deprecated
observeChangesIf
, addedsyncIf
instead - added
RecyclerView.observeAdapter()
- added
ViewAnimator.bindDisplayedChildTo(indexProperty: Property<Int>)
- added
LazyView
- deprecated bindings to Support library
0.0.15
SQL
Trigger-based observability
Mutating SQL templates
Deprecated Record-based API
Session: implemented Closeable, added trimMemory()
HTTP
Removed Exchange implicit receiver from handler functions.
Android JSON on JVM
With this module you can use android.util.JsonReader/Writer outside of Android along with :android-json bindings.
Extended persistence
Added IncrementalN<…>
type which is a special partial tuple. For example, Incremental3<Int, String, Long>
is analogous to Either4<Unit, Int, Pair<Int, String>, Triple<Int, String, Long>>
0.0.14
Android-JSON
Extracted JSON-related things from Android Bindings. Android-JSON is Java library, so you can pretend you have android.util.Json* and reuse it outside Android.
- Fixed JSON path state after lenient []/{} read
Persistence
- Java-friendly enum type constructor and Partial.load function
Extended Persistence
- Added Box and Unit types
- Java-friendly tuple constructors and destructuring functions, Either types
- some fixes around TokenStream transforms
HTTP
- allowed building address without schema, i. e. starting with
//
- fixes for blob/byteArray types in query parameters etc
- Undertow support for server-side
0.0.13
Persistence
- Java interop:
@JvmName("newStruct")
onoperator fun invoke(…): Struct<SCH>
- added
TokenStream.iteratorOfTransient
- Some types can have different binary and text representations (e. g. UUID tends to be byte[] in binary, but becomes hex-with-hyphens in JSON)
Extended Persistence
- Java interop:
@JvmName("newTuple")
onoperator fun invoke(…): Struct<Tuple>
- Either: some deprecations (required for better Java interop in future); added
map
,fold
, andunwrap
functions
SQL
- PostgreSQL support; native and overridden SQL types
- When fetching single cell or struct, you can choose what to do if result set if empty
- Separate APIs for fetching “stable” and “transient” structs — added
Lazily.transientStructs()
- Some cleanup around
Table
s and DAO-based API
JavaFX bindings
- added
Labeled.bindTextTo
,Node.bindEnabledTo
HTTP
Introduced :http
module for type-safe URL building, requesting, and routing.
0.0.12
Persistence
Lens
became(Struct) -> T
instead of(Partial) -> T
, deprecatedofStruct()
, addedofPartial()
- Renamed
DataType
s which are Java keywords (int
,long
,enum
etc) to be Rust keywords (i32
,i64
) or just non-keywords (enumeration
) for Java interop possibilities TokenStream.iteratorOf(type)
for reading streams on demand- Renamed
schema.build
toinvoke
,Player.build {
=>Player {
(similarly to Rust struct literals)
Extended Persistence
- added
t1 * t2 * t3
=>Tuple3("first", t1, "second", t1, "third", t3)
factories - added
t1 + t2 + t3
=>either3("first", t1, "second", t1, "third", t3)
factories
Properties
- added
MutableProperty<Boolean>.flip()
- many
FieldSet.intersect(FieldSet)
overloads with intersected return type
SQL
- fixed support for non-long primary keys in SqliteSession
- added JDBC/SQLite templates (
Session.query
API) with abilities to fetchEagerly
andLazily
- added
projection(schema): Table
— a factory method for building anonymous tables useful for raw queries - added
NestingCase
—NamingConvention
for, well, nesting (outer.inner) - added
transaction.insertAll(table, iterator)
Android Bindings
- internal binding optimizations
- removed Lifecycle Watcher Fragment which worked incorrectly
0.0.11
Persistence
Added TokenStream
API, coroutine-based tokens { yield... }
builder.
Extended persistence
Added transforms for TokenStream
s: inline
, outline
, associate
, entries
.
Android bindings
Re-implemented JSON reading and writing on top of streams: jsonString.reader().json()....
0.0.10
Persistence
- exact data types are now exposed by type parameters:
type: DataType<T>
->type: DT where DT : DataType<T>
Extended persistence
- Added Tuple and Either types
SQL
- Supported storing Partials of other runtime representations then Struct/PartialStruct, e. g. Either
Android Bindings
- moved
.properties.android.persistence
to.persistence.android
- moved some Suport and Design bindings, added duplicates for AndroidX and Material
Android Sample
Rewritten UI with Splitties instead of obsolete Anko.
0.0.9
Android bindings
+View.setWhenLongClicked(clickedProperty: MutableProperty<Boolean>)
-SharedPreferenceProperty<T> : MutableProperty<T>
+SharedPreferenceProperty<T> : TransactionalProperty<SharedPreferences.Editor, T>
Persistence
+PartialStruct<SCH : Schema<SCH>>
+Lens<SCH : Schema<SCH>, in STR : PartialStruct<SCH>, T> : (STR) -> T?
+Lens<SCH, Struct<SCH>, T>.ofStruct(): (Struct<SCH>) -> T
+NamedLens<SCH : Schema<SCH>, in STR : PartialStruct<SCH>, T> : Lens<SCH, STR, T>
-FieldDef<SCH : Schema<SCH>, T> : (Struct<SCH>) -> T
+FieldDef<SCH : Schema<SCH>, T> : NamedLens<SCH, PartialStruct<SCH>, T>
-StructTransaction<SCH>.setFrom(source: Struct<SCH>, fields: FieldSet<SCH, FieldDef.Mutable<SCH, *>>)
+StructTransaction<SCH>.setFrom(source: PartialStruct<SCH>, fields: FieldSet<SCH, FieldDef.Mutable<SCH, *>>): FieldSet<SCH, FieldDef.Mutable<SCH, *>>
sealed class DataType<T> {
+ abstract class Partial<T, SCH : Schema<SCH>> : DataType<T>
}
Properties
- computed diff property cancels computation when gets unobserved
interface PropertiesMemento {
+ fun reader(): PropertyIo
}
class ObservableStruct<SCH : Schema<SCH>> : BaseStruct<SCH>, PropertyStruct<SCH> {
- fun setFrom(source: Struct<SCH>, fields: FieldSet<SCH, FieldDef.Mutable<SCH, *>>)
+ fun setFrom(source: PartialStruct<SCH>, fields: FieldSet<SCH, FieldDef.Mutable<SCH, *>>): FieldSet<SCH, FieldDef.Mutable<SCH, *>>
}
SQL
Great work on supporting embedded [nullable] [partial] structs as the simplest form of 'relations'
Added extended-persistence
+partial(schema: SCH): DataType.Partial<PartialStruct<SCH>, SCH>
+class PartialStructSnapshot<SCH : Schema<SCH>> : BaseStruct<SCH>
+PartialStruct<SCH>.getOrNull(field: FieldDef<SCH, T>): T?
+PartialStruct<SCH>.getOrDefault(field: FieldDef<SCH, T>, defaultValue: T): T
+PartialStruct<SCH>.getOrElse(field: FieldDef<SCH, T>, defaultValue: () -> T): TSCH.buildPartial(build: +SCH.(StructBuilder<SCH>) -> Unit): PartialStruct<SCH>
+Struct<SCH>.take(fields: FieldSet<SCH, FieldDef<SCH, *>>): PartialStruct<SCH>
+PartialStruct<SCH>.copy(fields: FieldSet<SCH, FieldDef<SCH, *>>, mutate: SCH.(StructBuilder<SCH>) -> Unit): PartialStruct<SCH>
+byteCollection: DataType.Collect<ByteArray, Byte>
+shortCollection: DataType.Collect<ShortArray, Short>
+intCollection: DataType.Collect<IntArray, Int>
+longCollection: DataType.Collect<LongArray, Long>
+floatCollection: DataType.Collect<FloatArray, Float>
+doubleCollection: DataType.Collect<DoubleArray, Double>
+uByte: DataType.Simple<UByte>
+uShort: DataType.Simple<UShort>
+uInt: DataType.Simple<UInt>
0.0.8
Persistence
Added
fun <SCH : Schema<SCH>> Struct<SCH>.copy(mutate: SCH.(StructBuilder<SCH>) -> Unit): StructSnapshot<SCH>
Deprecated
fun <E : Enum<E>, U : Any> enum(encodeAs: DataType.Simple<U>, encode: (E) -> U, fallback: (U) -> E = ...): DataType.Simple<E>
Properties
Added
fun <E : Enum<E>> enum(fallback: (String) -> E = ...): DataType.Simple<E>
- fixed a critical typo in
InMemoryPropertiesMemento.writeTo
- fixed possible correctness problem when bi- and multi-mapped properties have sources with mixed concurrentness — some incorrect code may crash now
- less memory impact when updating single-threaded bi- and multi-mapped properties
Minor signature changes:
fun <T> Property<T>.onEach(func: (T) -> Unit): Unit =>
fun <P : Property<T>, T> P.onEach(func: (T) -> Unit): P
fun MutableProperty<Boolean>.clearEachAnd(crossinline action: () -> Unit): Unit =>
fun <P : MutableProperty<Boolean>> P.clearEachAnd(crossinline action: () -> Unit): P
fun <T : Any> MutableProperty<T?>.clearEachAnd(crossinline action: (T) -> Unit): Unit =>
fun <P : MutableProperty<T?>, T : Any> P.clearEachAnd(crossinline action: (T) -> Unit): P
Android bindings
- fixed
ParcelPropertiesMemento.CREATOR
field to have exactlyParcelable$Creator
type and be compatible with common ProGuard rules
SQL
- fixed critical
SqliteDialect
codegen problem around nullable types
Android-specific stats
Module | Defined methods | ~DEX size, KB |
---|---|---|
persistence | 220 | 31.5 |
properties | 540 | 84.3 |
Android bindings | 272 | 38.1 |
SQL | 316 | 60.2 |