system.asciidoc 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[sql-functions-system]]
  4. === System Functions
  5. These functions return metadata type of information about the system being queried.
  6. [[sql-functions-system-database]]
  7. ==== `DATABASE`
  8. .Synopsis:
  9. [source, sql]
  10. --------------------------------------------------
  11. DATABASE()
  12. --------------------------------------------------
  13. *Input*:
  14. *Output*: string
  15. .Description:
  16. Returns the name of the database being queried. In the case of Elasticsearch SQL, this
  17. is the name of the Elasticsearch cluster. This function should always return a non-null
  18. value.
  19. ["source","sql",subs="attributes,callouts,macros"]
  20. --------------------------------------------------
  21. include-tagged::{sql-specs}/docs.csv-spec[database]
  22. --------------------------------------------------
  23. [[sql-functions-system-user]]
  24. ==== `USER`
  25. .Synopsis:
  26. [source, sql]
  27. --------------------------------------------------
  28. USER()
  29. --------------------------------------------------
  30. *Input*:
  31. *Output*: string
  32. .Description:
  33. Returns the username of the authenticated user executing the query. This function can
  34. return `null` in case Security is disabled.
  35. ["source","sql",subs="attributes,callouts,macros"]
  36. --------------------------------------------------
  37. include-tagged::{sql-specs}/docs.csv-spec[user]
  38. --------------------------------------------------