Exactly right - the data-first (or contract-first for APIs) is a better abstraction barrier than object-first (or data + code mixed together). Most query languages respect this, and when they do not, it usually ends up being a dead end. That includes ideas like embedded a JVM in an Oracle SQL database or various NoSQL systems that have tried embedding Javascript or other general purpose programming languages.