Context Functions This page provides reference information for the context-related functions in TiDB Cloud Lake. These functions return information about the current session, database, or system context.
Function Description Example CONNECTION_ID Returns the connection ID for the current connection CONNECTION_ID() → 42CURRENT_USER Returns the user name and host for the current connection CURRENT_USER() → 'root'@'%'LAST_QUERY_ID Returns the query ID of the last executed query LAST_QUERY_ID() → '01890a5d-ac96-7cc6-8128-01d71ab8b93e'
Database Context Functions Function Description Example CURRENT_CATALOG Returns the name of the current catalog CURRENT_CATALOG() → 'default'DATABASE Returns the name of the current database DATABASE() → 'default'
Function Description Example VERSION Returns the current version of TiDB Cloud Lake VERSION() → 'LakeQuery v1.2.252-nightly-193ed56304'