Repository navigation
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 supportWhat's new
- Search options:
SearchOptionsoverload of the 12 escaped search methods on the query
builder and the model builder, and avalidateSearchOptionshook a grammar overrides. - Collection and object casts:
Casts.collection()andCasts.object()read a stored JSON
array as aListand a JSON object as aMap. - Encrypted casts:
AttributeEncrypter,Model.attributeEncrypter()andCasts.encrypted()
(alsoencrypted:array,encrypted:json,encrypted:collection,encrypted:object). Diwan does
no cryptography: the model supplies the encrypter. - Hashed cast:
AttributeHasher,Model.attributeHasher()andCasts.hashed(). The model
supplies the hasher. - Binary ids:
Casts.binaryUuid(),Casts.binaryUlid()andBinaryIds, stored as 16 bytes in
abinary()column. - Factories:
FactoryandSequencebuild models withmake,create,rawandinsert,
with states, sequences,afterMakingandafterCreatinghooks, related models (has,
hasAttached,forParent) andrecycle.
Deprecated
- The 24
boolean caseSensitivesearch overloads andQueryGrammar.searchPattern(String, SearchWhere.Anchor, boolean), for removal in 0.6.0. UseSearchOptions.caseSensitive()in
place oftrue.
See the changelog for the full
list.
Links
- Documentation: https://aristonis.org/open-source/diwan-database/docs/main/home
- Full changelog: CHANGELOG.md
- Report a security problem privately: SECURITY.md