Configure a database. Submit a PathQL query. Get nested JSON back.


PathQL extends standard SQL

PathQL intelligently structures SQL query results as nested JSON using your database’s foreign keys. You can optionally use JSONPath notation to customize the structure. This gives clients the power to ask for exactly what they need and nothing more.

select 
    posts.id, posts.title, posts.content, posts.created,
    comments.id, comments.message
from 
    posts
left join
    comments on comments.post_id = posts.id
where
    posts.id = 1

Ask for what you need, get exactly that

Send a PathQL query to your API and get exactly what you need, nothing more and nothing less. PathQL queries always return structured results in JSON. While typical REST APIs require loading from multiple URLs, PathQL APIs get all the data your app needs in a single request. Apps using PathQL can be quick even on slow mobile network connections.

{
    "posts": [
        {
            "id": 1,
            "title": "Hello world!",
            "content": "Welcome to the first post.",
            "created": "2018-03-05T20:12:56Z",
            "comments": [
                {
                    "id": 1,
                    "message": "Hi!"
                },
                {
                    "id": 2,
                    "message": "Thank you."
                }
            ]
        }
    ]
}

Built on standards

PathQL leverages SQL and your database schema to automatically infer JSON structure from foreign key relationships. You can optionally use JSONPath notation in SQL comments to customize the structure. While typical REST APIs require loading from multiple URLs, PathQL can get all the data your app needs in a single request.

Automatic Inference

  • Analyzes foreign keys
  • Detects one-to-many relationships
  • Nests data intelligently
  • Zero configuration needed

Optional PATH hints

– PATH alias $.custom[].path

  • ”$” root element
  • ”.” object child operator
  • ”[]” array element operator
$.posts[].comments[].message
\__________________/ \_____/
      |                 |
 base path     property name

Create APIs that are consistent and documented

PathQL APIs are organized in an endpoint that is described with an OpenAPI specification. Next to your API documentation you can provide the SQL documentation of your DBMS and an ERD. Authorization is executed in the DBMS using GRANT statements and thus fully documented.

Swagger Editor

Move faster with familiar developer tools

PathQL is an extension to SQL that allows you to structure the resulting JSON. This means that you can keep using the tools you are familiar with, such as DBeaver to create complex queries. And if you want to add a resource to your API, then you simply add a table to your database.

DBeaver

Follow
Follow