Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • A api
  • Project information
    • Project information
    • Activity
    • Members
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Activity
Collapse sidebar
  • ironapi
  • api
  • Wiki
  • Entity Query vs Instance Query

Last edited by Andrea Pavlovic Mar 09, 2022
Page history

Entity Query vs Instance Query

Once the internal ID of a database entry is known, there are two API endpoints available to retrieve this entity.

Of course, the query endpoint would work:

POST /data/system/entity/query

{
  "conds": {
    "me.id": 2
  }
}

But this also does a table and result count to include in the reply, so the instance queries which do not do so will be faster.

To get only the instance itself, no joined data:

GET /data/system/entity/2

Should you need joins of function calls etc:

POST /data/system/entity/2/query

{
  "attrs": {
    "prefetch": [
      "module"
    ],
    "+select": [
      {
        "coalesce": "me.description,me.label"
      }
    ],
    "+as": [
      "mytext"
    ]
  }
}
Clone repository
  • API
    • Available Endpoints
    • Changing Passwords
    • Form Input Types
    • Introduction
    • Logout
    • Plugins
    • Queries
    • Queries
      • Attributes
      • Context
      • Query Examples
      • Query Search Options
      • Referenced Instances
      • Saved Queries
    • Schema_Changes
    • Storing Files
View All Pages