> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

> Reference material for CURRENT_DATABASE function

# CURRENT_DATABASE

export const QueryWindow = ({content}) => {
  const {sql, result} = content;
  const [inited, setInited] = useState(false);
  const buttonRef = useRef(null);
  useEffect(() => {
    if (!inited && buttonRef.current) {
      runQuery(buttonRef.current, true);
      setInited(true);
    }
  }, []);
  return <div className="query-window">
      <div className="query-toolbar">
        <button className="run-button" onClick={ev => runQuery(ev.target)} ref={buttonRef}>Run Query</button>
        <span className="window-title">Interactive SQL Playground 🔥</span>
      </div>
      <div className="query-content">
        <pre><code className="firebolt-sql language-sql" contentEditable="true" spellCheck="false" data-original-query={sql}>{sql}</code></pre>
        <script type="application/json" className="fallback-result" style={{
    display: "none"
  }}>{JSON.stringify(result)}</script>
        <div className="server-unavailable-banner query-window-hidden">
          The Firebolt playground server is currently unavailable. Using precomputed query results.
        </div>
        <div className="query-results"></div>
      </div>
    </div>;
};

Returns the current database name

## Syntax

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
CURRENT_DATABASE()
```

## Return Types

`TEXT`

## Example

<QueryWindow
  content={{
"sql": "SELECT CURRENT_DATABASE() as database;",
"result": {
"data": [
  [
    "demo_db"
  ]
],
"meta": [
  {
    "name": "database",
    "type": "text"
  }
],
"query": {
  "query_id": "8a3b0592-d9f8-4690-9130-0cbf253f622c",
  "query_label": null,
  "request_id": "62a37853-9e31-47a8-82d3-25f4be1c0653"
},
"rows": 1,
"statistics": {
  "bytes_read": 1,
  "elapsed": 0.034756,
  "rows_read": 1,
  "scanned_bytes_cache": 0,
  "scanned_bytes_storage": 0,
  "time_before_execution": 0.000243882,
  "time_to_execute": 0.000115415
}
}
}}
/>
