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
  • Api
  • Queries
  • Attributes

Attributes · Changes

Page history
x authored Jan 21, 2022 by Andrea Pavlovic's avatar Andrea Pavlovic
Show whitespace changes
Inline Side-by-side
API/Queries/Attributes.md
View page @ e54a0e4c
...@@ -208,22 +208,28 @@ Returns one row: ...@@ -208,22 +208,28 @@ Returns one row:
Ordering can be defined by the "order_by" attribute. Ordering can be defined by the "order_by" attribute.
Given | Will Generate | Given | Will Generate|
--------------------------------------------------------------- |----|-----------|
"colA" | ORDER BY colA |"colA" | ORDER BY colA|
["colA", "colB"] | ORDER BY colA, colB |["colA", "colB"] | ORDER BY colA, colB|
{"-asc" : "colA"} | ORDER BY colA ASC |{"-asc" : "colA"} | ORDER BY colA ASC|
{"-desc" => "colB"} | ORDER BY colB DESC |{"-desc" => "colB"} | ORDER BY colB DESC|
["colA", {-asc => "colB"}] | ORDER BY colA, colB ASC |["colA", {-asc => "colB"}] | ORDER BY colA, colB ASC|
{ "-asc" => ["colA","colB"] } | ORDER BY colA ASC, colB ASC |{ "-asc" => ["colA","colB"] } | ORDER BY colA ASC, colB ASC|
[ "FUNC(colA,?)", "bla" ] | ORDER BY FUNC(colA, ?) /* with "bla bound to ? */ |[ "FUNC(colA,?)", "bla" ] | ORDER BY FUNC(colA, ?) /* with "bla bound to ? */|
[ | ORDER BY |[ | ORDER BY
{ "-asc" => "colA" }, | colA ASC, { "-asc" => "colA" },
{ "-desc" => ["colB"] }, | colB DESC, { "-desc" => ["colB"] },
{ "-asc" => ["colC","colD"] },| colC ASC, colD ASC, { "-asc" => ["colC","colD"] },
[ "FUNC(colF, ?)", "bla" ], | FUNC(colF, ?) /* with "bla bound to ? */ [ "FUNC(colF, ?)", "bla" ],
] | ] |
```colA ASC,
colB DESC,
colC ASC, colD ASC,
FUNC(colF, ?) /* with "bla bound to ? */```
The API also supports [similarity](/API/Queries/Query-Search-Options#similarity) for sorting. The API also supports [similarity](/API/Queries/Query-Search-Options#similarity) for sorting.
Any column from a joined/prefetched table or a column selected with ["select"](#select-as) can be used. Any column from a joined/prefetched table or a column selected with ["select"](#select-as) can be used.
......
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