system.asciidoc 1.4 KB

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