📄️ Protocol Overview
A protocol is a JSON file that tells ONQL how your data should look from the query side — entity aliases, field names, joins, and authorization. Each protocol is registered under a password, and every query specifies which protocol to use via protopass.
📄️ Entities
An entity is the protocol's name for "a queryable thing." It usually maps 1:1 to a database table, but it doesn't have to.
📄️ Fields
The fields block tells ONQL which columns exist on an entity and what to call them in queries.
📄️ Relations
The relations block declares foreign-key relationships between entities. Once declared, you can walk them in any query at any depth.
📄️ Context Rules
context is the protocol section that lets you delete your API layer. It declares automatic row-level scoping rules — one per "kind of caller."
📄️ Real-World Examples
End-to-end protocol files you can copy, paste, and adapt.