Repository navigation
v0.3.1
Diwan Database 0.3.1
A fix release for 0.3.0, from reports by apps on 0.3.0. Code written for 0.3.0 compiles and runs
unchanged.
Install
implementation("org.aristonis:diwan-database:0.3.1")
implementation("org.aristonis:diwan-database-sqlite:0.3.1") // or -pgsql
implementation("org.aristonis:diwan-database-eloquent:0.3.1") // models, optional
implementation("org.aristonis:diwan-database-android:0.3.1") // Android driver, optional
testImplementation("org.aristonis:diwan-database-testing:0.3.1") // test supportFixed
- SQLite and Android truncate with restrict keys:
truncate()andtruncate(List)failed with
a foreign key violation on a table whoserestrictOnDelete()key refers to its own table, so
RefreshDatabasetruncate mode left the rows behind and later test classes failed on duplicates.
SQLite checks a restrict key row by row, even when deferred. When such a key links the listed
tables, the deletes now run outside a transaction with foreign key enforcement off, and any row
left pointing at an emptied table fails the truncate and undoes it. Other keys keep their cascade
and set-null actions. Inside a transaction, such a key still fails. - PostgreSQL restrict violations: SQL state 23001 (
restrict_violation, raised for a
restrictOnDelete()key) is now aForeignKeyViolationException, and
DriverException.error().key()names the constraint, as for 23503.
Links
- Documentation: https://aristonis.org/open-source/diwan-database/docs/main/home
- Full changelog: CHANGELOG.md
- Report a security problem privately: SECURITY.md