This documentation contains work-in-progress information for future Elastic Stack and Cloud releases. Use the version selector to view supported release docs. It also contains some Elastic Cloud serverless information. Check out our serverless docs for more details.
System Functions
editSystem Functions
editThese functions return metadata type of information about the system being queried.
DATABASE
editSynopsis:
DATABASE()
Input: none
Output: string
Description: Returns the name of the database being queried. In the case of Elasticsearch SQL, this is the name of the Elasticsearch cluster. This function should always return a non-null value.
SELECT DATABASE(); DATABASE --------------- elasticsearch