Summary
The useSoftDeletes trait adds a deleted_at column and ModelInstance.delete() correctly sets it, but ModelQueryBuilder never appends deleted_at IS NULL to reads. Every query().get(), find(), count(), paginate(), aggregate, and eager-load returns soft-deleted rows. There is also no withTrashed / onlyTrashed / restore.
Evidence (repro, sqlite)
after p2.delete(): Post.query().get() -> 2 rows ["A","B"]; Post.query().count() -> 2The deleted row is still returned.
Location
src/orm.ts — buildQuery() (~1888), count() (~2107), aggregate, pluck, and the eager-load paths.
Suggested fix
When definition.traits?.useSoftDeletes (or its softDeletable alias) is set, auto-inject deleted_at IS NULL into all read SQL, and add withTrashed() / onlyTrashed() / restore().
Severity: high (core trait silently broken). Found via internal code audit.