added query().total(true) and prevent foreign-keys from creating records except on save()