system.asciidoc 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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*: _none_
  14. *Output*: string
  15. *Description*: Returns the name of the database being queried. In the case of Elasticsearch SQL, this
  16. is the name of the Elasticsearch cluster. This function should always return a non-null
  17. value.
  18. [source, sql]
  19. --------------------------------------------------
  20. include-tagged::{sql-specs}/docs/docs.csv-spec[database]
  21. --------------------------------------------------
  22. [[sql-functions-system-user]]
  23. ==== `USER`
  24. .Synopsis:
  25. [source, sql]
  26. --------------------------------------------------
  27. USER()
  28. --------------------------------------------------
  29. *Input*: _none_
  30. *Output*: string
  31. *Description*: Returns the username of the authenticated user executing the query. This function can
  32. return `null` in case <<elasticsearch-security,security>> is disabled.
  33. [source, sql]
  34. --------------------------------------------------
  35. include-tagged::{sql-specs}/docs/docs.csv-spec[user]
  36. --------------------------------------------------