system.asciidoc 1.3 KB

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