Skip to content

v0.5.0

Latest

Choose a tag to compare

@mekadalibrahem mekadalibrahem released this 13 Nov 19:52

Diwan Database 0.5.0

Model data: one options argument for escaped search, collection and object casts, encrypted and
hashed casts with an encrypter and a hasher you supply, binary UUID and ULID casts, and model
factories for tests and seeding. Nothing breaks; the boolean search overloads are deprecated.

Install

implementation("org.aristonis:diwan-database:0.5.0")
implementation("org.aristonis:diwan-database-sqlite:0.5.0")   // or -pgsql
implementation("org.aristonis:diwan-database-eloquent:0.5.0") // models, optional
implementation("org.aristonis:diwan-database-android:0.5.0")  // Android driver, optional
testImplementation("org.aristonis:diwan-database-testing:0.5.0") // test support

What's new

  • Search options: SearchOptions overload of the 12 escaped search methods on the query
    builder and the model builder, and a validateSearchOptions hook a grammar overrides.
  • Collection and object casts: Casts.collection() and Casts.object() read a stored JSON
    array as a List and a JSON object as a Map.
  • Encrypted casts: AttributeEncrypter, Model.attributeEncrypter() and Casts.encrypted()
    (also encrypted:array, encrypted:json, encrypted:collection, encrypted:object). Diwan does
    no cryptography: the model supplies the encrypter.
  • Hashed cast: AttributeHasher, Model.attributeHasher() and Casts.hashed(). The model
    supplies the hasher.
  • Binary ids: Casts.binaryUuid(), Casts.binaryUlid() and BinaryIds, stored as 16 bytes in
    a binary() column.
  • Factories: Factory and Sequence build models with make, create, raw and insert,
    with states, sequences, afterMaking and afterCreating hooks, related models (has,
    hasAttached, forParent) and recycle.

Deprecated

  • The 24 boolean caseSensitive search overloads and QueryGrammar.searchPattern(String, SearchWhere.Anchor, boolean), for removal in 0.6.0. Use SearchOptions.caseSensitive() in
    place of true.

See the changelog for the full
list.

Links